From 996e47bf610c5b3ea22ea429b8c9a338db20fe0a Mon Sep 17 00:00:00 2001 From: Eric GELOEN Date: Fri, 6 Jul 2012 17:49:03 +0200 Subject: [PATCH] Replaced a shallow-copy with a deep-copy to avoid side effects. --- lib/Doctrine/ORM/Tools/Pagination/Paginator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index e9e3a4d92..202602015 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -208,7 +208,11 @@ class Paginator implements \Countable, \IteratorAggregate { /* @var $cloneQuery Query */ $cloneQuery = clone $query; - $cloneQuery->setParameters($query->getParameters()); + + foreach ($query->getParameters() as $parameter) { + $cloneQuery->setParameter($parameter->getName(), $parameter->getValue(), $parameter->getType()); + } + foreach ($query->getHints() as $name => $value) { $cloneQuery->setHint($name, $value); }