Replaces the magic method __call() for mapper classes
@param string $name
@param array $arguments
967411
protected function _preCall(&$name, array &$args) {
        if (!method_exists($this, $name)) {
            $settings = $this->getCachedSettings($name);
            if (array_key_exists('reference', $settings['attrs']) || $settings['type'] == 'ReferenceMany') {
                $modelTable = array_key_exists('model', $settings['attrs']) ?
                        $settings['attrs']['model'] :
                        $settings['attrs']['reference']['model'];
                $columnValue = is_object($this->$name) ? $this->$name->getArrayCopy() : $this->$name;
                $nam = !is_array($columnValue) ? explode('__:DS:__', $columnValue) : $columnValue;
                $column = array_key_exists('column', $settings['attrs']) ?
                        $settings['attrs']['column'] :
                        $settings['attrs']['reference']['column'];
                $args['relateWhere'] = array();
                foreach ($nam as $val) {
                        $args['relateWhere'][] = array($column => $val);
                }
            }
            if ($modelTable || (!$modelTable && $modelTable = self::getModelTable(Util::camelTo_($name)))) {
                $model = is_array($modelTable) ?
                        new $modelTable[count($modelTable) - 1] :
                        new $modelTable;

                $name = $model->getTableName();
                if (!isset($args[0]['returnType']) || $args[0]['returnType'] == Table::RETURN_MODEL){
                    $relTable = $this->getConnection()->table($name);

                    $model->setConnection($this->getConnection());
                    $model->init($relTable);
                    $args['model'] = $model;
                }
            }
        }
    }
594751
public function callStatic($name, array $arguments) {
		if(isset($this->statics[$name]))
			return call_user_func_array($this->statics[$name], $arguments);
		else {
			foreach($this->staticsCatchAll as $behavior) {
				$processed = false;
				$res = call_user_func_array([$behavior, 'staticCatchAll'], [$name, $arguments, &$processed]);
				if($processed)
					return $res;
			}

			if(method_exists($this, $name))
				return call_user_func_array([$this, $name], $arguments);

			throw new \Exception('Static method '.$name.' does not exist for entity '.$this->entityClass);
		}
	}
677014
public static function create($name, callable $callback, ...$arguments) {

        try {

            return  new RpcMethod($name, $callback, ...$arguments);

        } catch (Exception $e) {

            throw $e;

        }

    }
1022148
public function call($name, $arguments)
    {
        if ($value = $this->cache->get($cacheKey = $this->cache->makeKey([$name, $arguments]))) {
            return $value;
        }

        $result = call_user_func_array([$this, $name], $arguments);

        if ($this->config->get('hydrate.before')) {
            $result = $this->hydrator->hydrate($result);
        }

        return $this->cache->set($cacheKey, $result, $this->config->get('cache.duration'));
    }
982988
protected function getResults($name, $args)
    {
        if (method_exists($this->scope, $name)) {
            return call_user_func_array(array($this->scope, $name), $args);
        }

        return $this->scope->call($name, $args);
    }
1329645
public function _call($name, $arguments)
    {
        $object = $this->getObject();
    	try
    	{
			$method = new \ReflectionMethod($object, $name);
		} catch (\Exception $e)
		{
		    if (method_exists($object, '__call'))
		    {
		        return call_user_func_array(array($object, '__call'), (array) $arguments);
		    } else
		    {
                throw new \Exception('Unable to invoke method ' . $name . ' on object of class ' . get_class($object));
		    }
		    return null;
		}

		$method->setAccessible(true);
		return $method->invokeArgs($object, $arguments);
    }
1364687
public function callTransformer($name, $arguments = [])
	{
		return call_user_func_array(array($this, 'transform' . ucfirst($this->snakeToCamel($name))), $arguments);
	}
1109805
public function helper($name, $args = [])
    {
        $args = func_get_args();
        $name = array_shift($args);
        if (isset($this->helpers[$name]) && is_callable($this->helpers[$name])) {
            return call_user_func_array($this->helpers[$name], $args);
        } elseif (($helper = [Helper::class, $name]) && is_callable($helper)) {
            return call_user_func_array($helper, $args);
        }

        throw new \RuntimeException(sprintf('undefined helper "%s" in %s line %d', $name, static::NAME, $this->getLineTrace()));
    }
705391
protected function addMethod($name, array $arguments = array())
    {
        $this->methods[] = new MethodCall($this, $name, $arguments);

        return $this;
    }
1003252
public function onModule($name, $arguments)
    {
        // Look in registered modules
        $key = isset($this->registered[$name]) ? $name : '__DEFAULT__';

        if (!isset($this->registered[$key])) {
            throw new ModuleNotFoundException($name, __CLASS__);
        }

        return $this->registered[$key]->$name(...$arguments);
    }
1250811
protected function newMethodSegment($name, array $arguments = [])
    {
        return $this->repositoryProvider->createRepository($this->newMethod($name, $arguments));
    }
938780
private function applySetOperator($name, array $args)
    {
        $reflection = new \ReflectionClass('\\Ruler\\Operator\\' . $name);
        array_unshift($args, $this);

        return $this->wrap($reflection->newInstanceArgs($args));
    }
63750
public function addMethod($name, callable $method)
    {
        $this->methods[$name] = \Closure::bind($method, $this, $this);

        return $this;
    }
135416
public static function trigger($name, $args) {
        if (array_key_exists($name, static::$events)) {
            $infos = static::$events[ $name ];
            if ($infos) {
                foreach ($infos as $info) {
                    $module = Ioc::get($info[ 'class' ]);
                    if ($info[ 'action' ]) {
                        static::doAction($module, $info[ 'action' ], $args);
                    }
                }
            }
        }
    }
995178
public function bindMap(string $name): MapBinding
    {
        if (!isset($this->mapBindings[$name])) {
            $this->mapBindings[$name] = $this->addBinding(new MapBinding($name));
        }

        return $this->mapBindings[$name];
    }
116743
public function call($name, $arguments = [])
    {
        return $this->runViaLaravelCollection(function ($collection) use (
            $name,
            $arguments
        ) {
            return call_user_func_array(
                [$collection, $name],
                $this->coollectizeCallbacks($this->__toArray($arguments), $name)
            );
        },
        $name);
    }
252961
public function call($name, array $params = [])
    {
        $this->checkName($name);

        array_unshift($params, $this);
        call_user_func_array($this->callbacks[$name], $params);

        return $this;
    }