private function getPager(Query $query, QueryDefinition $queryDefinition)
    {
        if ($queryDefinition->useFilter) {
            $adapter = new FilterAdapter($query, $this->filterService);
        } else {
            $adapter = new FindAdapter($query, $this->findService);
        }

        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($queryDefinition->maxPerPage);
        $pager->setCurrentPage($queryDefinition->page);

        return $pager;
    }
private function getPager(Query $query, QueryDefinition $queryDefinition)
    {
        if ($queryDefinition->useFilter) {
            $adapter = new FilterAdapter($query, $this->filterService);
        } else {
            $adapter = new FindAdapter($query, $this->findService);
        }

        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($queryDefinition->maxPerPage);
        $pager->setCurrentPage($queryDefinition->page);

        return $pager;
    }
private function getPager ( Query $ query , QueryDefinition $ queryDefinition ) { if ( $ queryDefinition -> useFilter ) { $ adapter = new FilterAdapter ( $ query , $ this -> filterService ) ; } else { $ adapter = new FindAdapter ( $ query , $ this -> findService ) ; } $ pager = new Pagerfanta ( $ adapter ) ; $ pager -> setNormalizeOutOfRangePages ( true ) ; $ pager -> setMaxPerPage ( $ queryDefinition -> maxPerPage ) ; $ pager -> setCurrentPage ( $ queryDefinition -> page ) ; return $ pager ; }
Return Pagerfanta instance by the given parameters.

@throws \Pagerfanta\Exception\Exception

@param \eZ\Publish\API\Repository\Values\Content\Query $query
@param \Netgen\Bundle\EzPlatformSiteApiBundle\QueryType\QueryDefinition $queryDefinition

@return \Pagerfanta\Pagerfanta
Return Pagerfanta instance by the given parameters .