Api\Controller\PageController::getAction PHP Метод

getAction() публичный метод

Action responsible to display info about single page entity.
public getAction ( ) : Phalcon\Http\ResponseInterface
Результат Phalcon\Http\ResponseInterface
    public function getAction()
    {
        //get entity from storage
        $pageId = (int) $this->request->getQuery('pageId');
        $page = \Page\Model\Page::findFirst($pageId);
        if (!$pageId || !$page) {
            return $this->render(new \Api\Model\Payload(null, sprintf('Page with id: %s was not found.', $pageId)));
        }
        //filter required data for display
        $filter = new \Api\Filter\Page();
        $payload = new \Api\Model\Payload($filter->filter($page));
        return $this->render($payload);
    }