Fix Paginator use

This commit is contained in:
Romain Neutron
2012-04-04 20:06:50 +02:00
parent a905fa499a
commit a2aa3b6840

View File

@@ -9,6 +9,8 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
use Doctrine\ORM\Tools\Pagination\Paginator;
/** /**
* *
* @package * @package
@@ -98,6 +100,9 @@ class patch_361 implements patchInterface
$dql = "SELECT b FROM Entities\Basket b WHERE b.description != ''"; $dql = "SELECT b FROM Entities\Basket b WHERE b.description != ''";
$n = 0;
$perPage = 100;
$query = $em->createQuery($dql) $query = $em->createQuery($dql)
->setFirstResult($n) ->setFirstResult($n)
->setMaxResults($perPage); ->setMaxResults($perPage);
@@ -106,9 +111,6 @@ class patch_361 implements patchInterface
$count = count($paginator); $count = count($paginator);
$n = 0;
$perPage = 100;
while ($n < $count) while ($n < $count)
{ {
$query = $em->createQuery($dql) $query = $em->createQuery($dql)