public function getPostCommentsAction($id, ParamFetcherInterface $paramFetcher)
    {
        $post = $this->getPost($id);

        $page = $paramFetcher->get('page');
        $count = $paramFetcher->get('count');

        $criteria = $this->filterCriteria($paramFetcher);
        $criteria['postId'] = $post->getId();

        /** @var PagerInterface $pager */
        $pager = $this->commentManager->getPager($criteria, $page, $count);

        return $pager;
    }
public function getPostCommentsAction($id, ParamFetcherInterface $paramFetcher)
    {
        $post = $this->getPost($id);

        $page = $paramFetcher->get('page');
        $count = $paramFetcher->get('count');

        $criteria = $this->filterCriteria($paramFetcher);
        $criteria['postId'] = $post->getId();

        /** @var PagerInterface $pager */
        $pager = $this->commentManager->getPager($criteria, $page, $count);

        return $pager;
    }
public function getPostCommentsAction ( $ id , ParamFetcherInterface $ paramFetcher ) { $ post = $ this -> getPost ( $ id ) ; $ page = $ paramFetcher -> get ( 'page' ) ; $ count = $ paramFetcher -> get ( 'count' ) ; $ criteria = $ this -> filterCriteria ( $ paramFetcher ) ; $ criteria [ 'postId' ] = $ post -> getId ( ) ; /** @var PagerInterface $pager */ $ pager = $ this -> commentManager -> getPager ( $ criteria , $ page , $ count ) ; return $ pager ; }
Retrieves the comments of specified post.

@ApiDoc(
requirements={
{"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post id"}
},
output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}},
statusCodes={
200="Returned when successful",
404="Returned when post is not found"
}
)

@REST\QueryParam(name="page", requirements="\d+", default="1", description="Page for comments list pagination")
@REST\QueryParam(name="count", requirements="\d+", default="10", description="Number of comments by page")

@REST\Route(requirements={"_format"="json|xml"})

@REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)

@param int                   $id           A post identifier
@param ParamFetcherInterface $paramFetcher

@return PagerInterface
Retrieves the comments of specified post .