/** * @param integer $actionId * @param \Fusio\Engine\RequestInterface $request * @param \Fusio\Engine\ContextInterface $context * @return \Fusio\Engine\ResponseInterface */ public function execute($actionId, RequestInterface $request, ContextInterface $context) { $repository = $this->getCurrentRepository(); $action = $repository->get($actionId); if ($action instanceof Model\ActionInterface) { $parameters = new Parameters($action->getConfig()); return $this->factory->factory($action->getClass())->handle($request, $parameters, $context->withAction($action)); } else { throw new RuntimeException('Could not found action ' . $actionId); } }
/** * @param integer $actionId * @param \Fusio\Engine\RequestInterface $request * @param \Fusio\Engine\ContextInterface $context * @return \Fusio\Engine\ResponseInterface */ public function execute($actionId, RequestInterface $request, ContextInterface $context) { $repository = end($this->stack); $action = $repository->getAction($actionId); if ($action instanceof ActionInterface) { $parameters = new Parameters($action->getConfig()); return $this->factory->factory($action->getClass())->handle($request, $parameters, $context->withAction($action)); } else { throw new ConfigurationException('Could not found action ' . $actionId); } }