예제 #1
0
 /**
  * @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);
     }
 }
예제 #2
0
파일: Processor.php 프로젝트: uqiauto/fusio
 /**
  * @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);
     }
 }