$keys = array('id', 'name', 'surname'); $values = array(1, 'john', 'smith'); $combined = Arrays::combine($keys, $values);
Array ( [id] => 1 [name] => john [surname] => smith )
public static function combine(array $keys, array $values) { if (empty($keys) || empty($values)) { return array(); } return array_combine($keys, $values); }
public static function __callStatic($name, $arguments) { Session::checkSession(); $dynamicFinder = DynamicFinder::match($name); if ($dynamicFinder) { $where = Arrays::combine($dynamicFinder->getNames(), $arguments); return static::where($where); } throw new BadMethodCallException('Method [' . $name . '] not exists'); }