Вызывает метод модуля расширения

@param string $method  имя метода
@param array  $args    аргументы

@return mixed

@throws Eresus_CMS_Exception_NotFound

@since 3.01
963726
private function call($method, array $args = array())
    {
        if (!method_exists($this->getPlugin(), $method))
        {
            throw new Eresus_CMS_Exception_NotFound;
        }

        return call_user_func_array(array($this->getPlugin(), $method), $args);
    }
1147213
public function set($method_or_arg, $method = null)
    {
        $method = is_callable($method_or_arg) ? $method_or_arg : $method;
        $arg = is_callable($method_or_arg) ? null : $method_or_arg;

        $self = $this;

        if ($this->isActive($arg)) {
            $this->app->addHook('post-init', function () use ($method, $self) {
                $page = $self->getPage();
                $page->id = $_GET[$self->name.'_id'];
                $self->app->stickyGET($self->name.'_id');

                try {
                    call_user_func($method, $page, $self);
                } catch (Exception $e) {
                    // post-init cannot catch StopInit
                    if ($e instanceof Exception_StopInit) {
                        return;
                    }
                    throw $e;
                    // exception occured possibly due to a nested page. We
                    // are already executing from post-init, so
                    // it's fine to ignore it.
                }

                //Imants: most likely forgetting is not needed, because we stop execution anyway
                //$self->app->stickyForget($self->name.'_id');
                //$self->app->stickyForget($self->name);
            });
            throw $this->exception('', 'StopInit');
        }

        return $this;
    }
624998
protected function doRun($method, array $args=[]) {
		ob_start();
		$result = call_user_func_array($method, array_merge([$this], $args));
		$controllerBuffer =  ob_get_clean();

		if($result !== null)
			return $result;
		if($controllerBuffer)
			return $controllerBuffer;
		return null;
	}
107870
protected static function invoke($method, array $arguments)
    {
        $target = [
            self::$engine,
            $method,
        ];

        return call_user_func_array($target, $arguments);
    }
330662
private function callFindAllBy(string $method, array $arguments)
    {
        $whereByWithUpper = lcfirst(substr($method, 9, mb_strlen($method)));
        $whereBy = Str::convertCamelCaseToSnakeCase($whereByWithUpper);

        return $this->where($whereBy, '=', $arguments[0])->findAll();
    }
1285984
protected function _circumventEventManager($method, $args = [])
    {
        EventManager::instance()->off('Model.initialize', [$this, 'footprint']);
        $result = call_user_func_array([TableRegistry::get($this->_userModel), $method], $args);
        EventManager::instance()->on('Model.initialize', [$this, 'footprint']);

        return $result;
    }
215365
public function form($method='request',array $args=null) {
        $method = $method === 'auto'?strtolower($this->method()):$method;
        $input = [];
        switch ($method) {
            case 'request':
                $input = $this->request;
                break;
            case 'post':
                $input = $this->post;
                break;
            case 'get':
                $input = $this->get;
                break;
            case 'request':
                $input = $this->request;
                break;
            case 'input':
                $input = $this->input;
                break;
            case 'put':
                parse_str($this->input, $input);
                break;
            case 'files':
                $input = $this->files;
                break;
            case 'server':
                $input = $this->server;
                break;
        }
        if($args) {
            $_input = [];
            foreach ($args as $arg) {
                $_input[$arg] = isset($input[$arg])?$input[$arg]:null;
            }
            $input = $_input;
        }
        return $input;
    }
1237980
private function random(string $method, array $arguments)
    {
        $redisPoolName = array_rand($this->goodPools);

        if (!isset(RedisProxyFactory::$redisCoroutines[$redisPoolName])) {
            if (getInstance()->getAsynPool($redisPoolName) == null) {
                return false;
            }
            RedisProxyFactory::$redisCoroutines[$redisPoolName] = getInstance()->getAsynPool($redisPoolName)->getCoroutine();
        }
        $redisPoolCoroutine = RedisProxyFactory::$redisCoroutines[$redisPoolName];

        return $redisPoolCoroutine->$method(...$arguments);
    }
343925
public function call(string $method, $args): \Generator
    {
        $request = new Request();
        $request->id = $this->idSequence->current();
        $this->idSequence->next();
        $request->method = $method;
        $request->params = $args;

        $serializedRequest = Json::encode($this->mapper->dump($request));
        $this->pendingRequests[$request->id] = yield Recoil::strand();
        yield Recoil::execute($this->transport->send($serializedRequest));

        /** @var ResultResponse|ErrorResponse $response */
        $response = yield Recoil::suspend();

        if ($response instanceof ErrorResponse) {
            throw $response->error;
        }

        return $response->result;
    }
1013009
public function execute($method, array $options = [], array $arguments = []) {
        $params = [];

        if (count($options) > 0) {
            $params['options'] = $options;
        }

        if (count($arguments) > 0) {
            $params['arguments'] = $arguments;
        }

        $result = $this->api->request(
            $method,
            $params
        );

        if (!array_key_exists('success', $result)) {
            throw new RuntimeException('Missing success status');
        }

        if (!is_bool($result['success']) || $result['success'] === false) {
            throw new RuntimeException('Command failed');
        }

        if (!array_key_exists('output', $result)) {
            throw new RuntimeException('Missing output');
        }

        if (!is_array($result['output'])) {
            throw new RuntimeException('Invalid output');
        }

        return $result['output'];
    }
1347757
private function callOrigin($method, $args, $callback)
    {
        $this->parseBefore($method, $args);
        // 原始方法调用
        $result = call_user_func_array($callback, $args);
        $this->parseAfter($method, $args);
        $this->parseAfterReturning($method, $args, $result);
        return $result;
    }
1290930
protected function __overloadMethods($method, $args)
	{
		$_method = strtolower($method);

		if (in_array($_method, ['prefix', 'suffix'])) {
			return call_user_func_array(array($this, 'affix'), array_merge([$_method], $args));
		}

		if ($_method == 'length') {
			return call_user_func_array(array($this, 'length'), $args);
		}

		throw new BadMethodCallException(sprintf("Call to unknown method %s::%s()", get_called_class(), $method));
	}
1207954
public function each($method, ...$args)
    {
        if ($this->count() === 0) {
            return 0;
        }
        $n = 0;
        foreach ($this as $obj) {
            $obj->$method(...$args);
            ++$n;
        }
        return $n;
    }
485568
public function send($method, $arguments)
    {
        $uri = $arguments[0];
        $params = isset($arguments[1]) ? $arguments[1] : [];
        if (substr($uri, 0, 1) !== '/') {
            $uri = '/' . $uri;
        }

        $response = $this->httpClient->send(
            new Request($method, new Uri($uri)),
            $params
        );

        return $response;
    }
936052
protected function assertColumn($method, $args)
    {
        if (array_key_exists($method, $this->types)) {
            return $this->ofType($this->types[$method]);
        }

        if (str_contains($method, ['default', 'Default'])) {
            return $this->defaults($args[0]);
        }

        if (str_contains($method, ['null', 'Null'])) {
            return $this->assertNullable(str_contains($method, 'not'));
        }

        throw new \Exception("The database table column assertion {$method} does not exist.");
    }
1128347
protected function decorateWhere($method, &$args)
    {
        $column = $args[0];
        $expression = isset($args[1]) ? $args[1] : null;
        $value = isset($args[2]) ? $args[2] : null;

        if (!$expression instanceof Entity && !$value instanceof Entity) {
            return;
        }

        $entity_class = $this->entity_class;
        $relation = $entity_class::getRelationDefinition($column);
        $column = $relation[3];
        $relation_column = $relation[2];
        if ($expression instanceof Entity) {
            $expression = $expression->getRaw($relation_column);
        } else {
            $value = $value->getRaw($relation_column);
        }

        $args = [$column, $expression, $value];
    }
1326895
public static function callMethod($object, $method, $args = null)
    {
        $args   = \func_get_args();
        $object = \array_shift($args);
        $method = \array_shift($args);

        $refl = new \ReflectionObject($object);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(true);

        return $reflMethod->invokeArgs($object, $args);
    }