main/core/Controller/ResourceController.php
public function executeAction($action, ResourceNode $resourceNode, Request $request)
    {
        // check the requested action exists
        if (!$this->actionManager->support($resourceNode, $action, $request->getMethod())) {
            // undefined action
            throw new NotFoundHttpException(
                sprintf('The action %s with method [%s] does not exist for resource type %s.', $action, $request->getMethod(), $resourceNode->getResourceType()->getName())
            );
        }

        // check current user rights
        $this->checkAccess($this->actionManager->get($resourceNode, $action), [$resourceNode]);

        // read request and get user query
        $parameters = $request->query->all();

        $content = null;

        if (!empty($request->getContent())) {
            $content = json_decode($request->getContent(), true);
        }
        $files = $request->files->all();

        // dispatch action event
        return $this->actionManager->execute($resourceNode, $action, $parameters, $content, $files);
    }
public function executeAction($action, ResourceNode $resourceNode, Request $request)
    {
        // check the requested action exists
        if (!$this->actionManager->support($resourceNode, $action, $request->getMethod())) {
            // undefined action
            throw new NotFoundHttpException(
                sprintf('The action %s with method [%s] does not exist for resource type %s.', $action, $request->getMethod(), $resourceNode->getResourceType()->getName())
            );
        }

        // check current user rights
        $this->checkAccess($this->actionManager->get($resourceNode, $action), [$resourceNode]);

        // read request and get user query
        $parameters = $request->query->all();

        $content = null;

        if (!empty($request->getContent())) {
            $content = json_decode($request->getContent(), true);
        }
        $files = $request->files->all();

        // dispatch action event
        return $this->actionManager->execute($resourceNode, $action, $parameters, $content, $files);
    }
public function executeAction ( $ action , ResourceNode $ resourceNode , Request $ request ) { // check the requested action exists if ( ! $ this -> actionManager -> support ( $ resourceNode , $ action , $ request -> getMethod ( ) ) ) { // undefined action throw new NotFoundHttpException ( sprintf ( 'The action %s with method [%s] does not exist for resource type %s.' , $ action , $ request -> getMethod ( ) , $ resourceNode -> getResourceType ( ) -> getName ( ) ) ) ; } // check current user rights $ this -> checkAccess ( $ this -> actionManager -> get ( $ resourceNode , $ action ) , [ $ resourceNode ] ) ; // read request and get user query $ parameters = $ request -> query -> all ( ) ; $ content = null ; if ( ! empty ( $ request -> getContent ( ) ) ) { $ content = json_decode ( $ request -> getContent ( ) , true ) ; } $ files = $ request -> files -> all ( ) ; // dispatch action event return $ this -> actionManager -> execute ( $ resourceNode , $ action , $ parameters , $ content , $ files ) ; }
Executes an action on one resource.

@EXT\Route("/{action}/{id}", name="claro_resource_action_short")
@EXT\Route("/{type}/{action}/{id}", name="claro_resource_action")

@param string       $action
@param ResourceNode $resourceNode
@param Request      $request

@return Response

@throws NotFoundHttpException
Executes an action on one resource .