Update lib/Doctrine/ORM/Tools/Pagination/Paginator.php
Replaced the foreach loop adding all IDs as single parameters with a single parameter which injects the IDs as an array.
This commit is contained in:
parent
88d0933a6e
commit
8a29d91d15
@ -179,15 +179,10 @@ class Paginator implements \Countable, \IteratorAggregate
|
|||||||
return new \ArrayIterator(array());
|
return new \ArrayIterator(array());
|
||||||
}
|
}
|
||||||
|
|
||||||
$namespace = WhereInWalker::PAGINATOR_ID_ALIAS;
|
|
||||||
|
|
||||||
$whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker'));
|
$whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\ORM\Tools\Pagination\WhereInWalker'));
|
||||||
$whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, count($ids));
|
$whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, count($ids));
|
||||||
$whereInQuery->setFirstResult(null)->setMaxResults(null);
|
$whereInQuery->setFirstResult(null)->setMaxResults(null);
|
||||||
foreach ($ids as $i => $id) {
|
$whereInQuery->setParameter(WhereInWalker::PAGINATOR_ID_ALIAS, $ids);
|
||||||
$i++;
|
|
||||||
$whereInQuery->setParameter("{$namespace}_{$i}", $id);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $whereInQuery->getResult($this->query->getHydrationMode());
|
$result = $whereInQuery->getResult($this->query->getHydrationMode());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user