/** * Retrieves the list of contexts (paginated) based on criteria. * * @ApiDoc( * resource=true, * output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}} * ) * * @QueryParam(name="page", requirements="\d+", default="1", description="Page for context list pagination") * @QueryParam(name="count", requirements="\d+", default="10", description="Number of contexts by page") * @QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled contexts filter") * * @View(serializerGroups="sonata_api_read", serializerEnableMaxDepthChecks=true) * * @param ParamFetcherInterface $paramFetcher * * @return PagerInterface */ public function getContextsAction(ParamFetcherInterface $paramFetcher) { $page = $paramFetcher->get('page'); $count = $paramFetcher->get('count'); /** @var PagerInterface $contextsPager */ $contextsPager = $this->contextManager->getPager($this->filterCriteria($paramFetcher), $page, $count); return $contextsPager; }