public function findPaginated(
        $entityClass,
        array $criteria,
        $sorting = [],
        $offset = Request\Params::DEFAULT_PAGE_OFFSET,
        $limit = Request\Params::DEFAULT_PAGE_SIZE,
        $translatable = false
    )
    {
        $qb = $this->getQueryBuilder($entityClass, $criteria, $sorting, $translatable);
        
        $qb->setFirstResult($offset)
            ->setMaxResults($limit);

        $paginator = new Paginator($qb->getQuery());
        $collection = new PaginatedCollection($paginator);

        return $collection;
    }
public function findPaginated(
        $entityClass,
        array $criteria,
        $sorting = [],
        $offset = Request\Params::DEFAULT_PAGE_OFFSET,
        $limit = Request\Params::DEFAULT_PAGE_SIZE,
        $translatable = false
    )
    {
        $qb = $this->getQueryBuilder($entityClass, $criteria, $sorting, $translatable);
        
        $qb->setFirstResult($offset)
            ->setMaxResults($limit);

        $paginator = new Paginator($qb->getQuery());
        $collection = new PaginatedCollection($paginator);

        return $collection;
    }
public function findPaginated ( $ entityClass , array $ criteria , $ sorting = [ ] , $ offset = Request \ Params :: DEFAULT_PAGE_OFFSET , $ limit = Request \ Params :: DEFAULT_PAGE_SIZE , $ translatable = false ) { $ qb = $ this -> getQueryBuilder ( $ entityClass , $ criteria , $ sorting , $ translatable ) ; $ qb -> setFirstResult ( $ offset ) -> setMaxResults ( $ limit ) ; $ paginator = new Paginator ( $ qb -> getQuery ( ) ) ; $ collection = new PaginatedCollection ( $ paginator ) ; return $ collection ; }
Helper method to paginate "find by" queries.
@param string $entityClass
@param array $criteria
@param array $sort
@param integer $offset
@param integer $limit
@param boolean $translatable
@return PaginatedCollection
Helper method to paginate find by queries .