public function paginatedAction(Request $request, ParamFetcherInterface $paramFetcher)
    {
        $this->checkAccess('FUNCTIONS_PAGINATED', null);
        $page = $paramFetcher->get('page', 1);
        $limit = $paramFetcher->get('limit', 32);
        $pager = $this->getResourceManager()->createPagerfantaPaginator($page, $limit);
        //$resources = $pager->getNbResults();
        $pagerfantaFactory = new PagerfantaFactory();
        $paginatedCollection = $pagerfantaFactory->createRepresentation(
            $pager, new \Hateoas\Configuration\Route(
                $this->getPaginatedActionRouteName(), array(), true)
        );
        $view = $this->view($paginatedCollection, \FOS\RestBundle\Util\Codes::HTTP_OK);
       
        return $this->handleView($view);
    }