original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Return Pagerfanta instance by the given parameters .