I am trying to implement pagination, using the latest version of Doctrine: https://doctrine-orm.readthedocs.org/en/latest/tutorials/pagination.html?highlight=doctrine%20dql%20pagination
$query = $this->getEntityManager()->createQuery(' SELECT b,pb FROM BookApi\Entity\Book b LEFT JOIN b.publisher pb ')->setFirstResult(0)->setMaxResults(10); $paginator = new Paginator($query, $fetchJoinCollection = true); $this->totalResults = count($paginator);
The count I get returned with the paginator is correct. However the getQuery does not give me ten results. It returns 5.
$output = $paginator->getQuery()->getArrayResult();
Is this the wrong approach?