RestBundle\Controller\RestController::getCommentsFromPostAction PHP Method

getCommentsFromPostAction() public method

List all comments from a post.
public getCommentsFromPostAction ( integer $id ) : FOS\RestBundle\View\View
$id integer
return FOS\RestBundle\View\View
    public function getCommentsFromPostAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $postComments = $em->getRepository('AppBundle:Post')->find($id);
        $view = new View($postComments->getComments());
        return $this->handleView($view);
    }