public function paginate($page = 1, $perPage = null)
    {
        $perPage = $perPage ?: $this->getMaxResults();
        $qb      = $this->createQueryBuilder();

        $qb->paginate($page, $perPage);

        return $this->getPaginator($qb);
    }
public function paginate($page = 1, $perPage = null)
    {
        $perPage = $perPage ?: $this->getMaxResults();
        $qb      = $this->createQueryBuilder();

        $qb->paginate($page, $perPage);

        return $this->getPaginator($qb);
    }
public function paginate ( $ page = 1 , $ perPage = null ) { $ perPage = $ perPage ? : $ this -> getMaxResults ( ) ; $ qb = $ this -> createQueryBuilder ( ) ; $ qb -> paginate ( $ page , $ perPage ) ; return $ this -> getPaginator ( $ qb ) ; }
Retrieve paginator.

@param int $page
@param int $perPage

@return Tools\Pagination\Paginator
@throws \ReflectionException
@throws \Xloit\Bridge\Doctrine\ORM\Exception\InvalidArgumentException
Retrieve paginator .