mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix Paginator use
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user