RestBundle\Controller\RestController::getCommentsAction PHP Метод

getCommentsAction() публичный Метод

List all comments.
public getCommentsAction ( ) : FOS\RestBundle\View\View
Результат FOS\RestBundle\View\View
    public function getCommentsAction()
    {
        $em = $this->getDoctrine()->getManager();
        $comments = $em->getRepository('AppBundle:Comment')->findAll();
        $view = $this->view($comments)->setTemplate('RestBundle:Comment:getComments.html.twig')->setTemplateVar('comments');
        return $this->handleView($view);
    }