Entity/EntityRepository.php
public function getPaginatedEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        $options = PaginatedEntityRepositoryOptionsResolver::createAndResolve($options);
        $queryBuilder = $this->addPagination(
            $this->getQueryBuilder($options['filters'], $options['sorting']),
            $options['elementsPerPage'],
            $options['page']
        );

        return new Paginator($queryBuilder->getQuery()->setHydrationMode($hydrationMode));
    }
public function getPaginatedEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        $options = PaginatedEntityRepositoryOptionsResolver::createAndResolve($options);
        $queryBuilder = $this->addPagination(
            $this->getQueryBuilder($options['filters'], $options['sorting']),
            $options['elementsPerPage'],
            $options['page']
        );

        return new Paginator($queryBuilder->getQuery()->setHydrationMode($hydrationMode));
    }
public function getPaginatedEntities ( array $ options = [ ] , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { $ options = PaginatedEntityRepositoryOptionsResolver :: createAndResolve ( $ options ) ; $ queryBuilder = $ this -> addPagination ( $ this -> getQueryBuilder ( $ options [ 'filters' ] , $ options [ 'sorting' ] ) , $ options [ 'elementsPerPage' ] , $ options [ 'page' ] ) ; return new Paginator ( $ queryBuilder -> getQuery ( ) -> setHydrationMode ( $ hydrationMode ) ) ; }
Returns a paginated list of entities.

@param array $options
@param integer $hydrationMode
@return \Doctrine\ORM\Tools\Pagination\Paginator
Returns a paginated list of entities .