src/Sulu/Bundle/ContactBundle/Entity/ContactRepository.php
private function addPagination($qb, $offset, $limit)
    {
        // Add pagination
        $qb->setFirstResult($offset);
        $qb->setMaxResults($limit);

        return $qb;
    }
private function addPagination($qb, $offset, $limit)
    {
        // Add pagination
        $qb->setFirstResult($offset);
        $qb->setMaxResults($limit);

        return $qb;
    }
private function addPagination ( $ qb , $ offset , $ limit ) { // Add pagination $ qb -> setFirstResult ( $ offset ) ; $ qb -> setMaxResults ( $ limit ) ; return $ qb ; }
add pagination to querybuilder.

@param QueryBuilder $qb
@param int|null $limit Page size for Pagination
@param int|null $offset Offset for Pagination

@return QueryBuilder
add pagination to querybuilder .