From bdb9bdfa7e3182acd6413e09e88a89b87fd66e82 Mon Sep 17 00:00:00 2001 From: Guillaume L Date: Tue, 9 Sep 2014 18:05:22 +0200 Subject: [PATCH] apply the patch from 2.4 branch : http://www.doctrine-project.org/jira/browse/DDC-1010 --- lib/Doctrine/ORM/AbstractQuery.php | 2 +- lib/Doctrine/ORM/EntityManager.php | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index e34394ff126..2daf49ba563 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -758,7 +758,7 @@ public function execute($parameters = null, $hydrationMode = null) return $stmt; } - $data = $this->_em->getHydrator($this->_hydrationMode)->hydrateAll( + $data = $this->_em->newHydrator($this->_hydrationMode)->hydrateAll( $stmt, $this->_resultSetMapping, $this->_hints ); diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 50e73824ce1..8a32fc91408 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -83,13 +83,6 @@ class EntityManager implements ObjectManager */ private $eventManager; - /** - * The maintained (cached) hydrators. One instance per type. - * - * @var array - */ - private $hydrators = array(); - /** * The proxy factory used to create dynamic proxies. * @@ -764,16 +757,14 @@ public function getUnitOfWork() * This method caches the hydrator instances which is used for all queries that don't * selectively iterate over the result. * + * @deprecated + * * @param int $hydrationMode * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator */ public function getHydrator($hydrationMode) { - if ( ! isset($this->hydrators[$hydrationMode])) { - $this->hydrators[$hydrationMode] = $this->newHydrator($hydrationMode); - } - - return $this->hydrators[$hydrationMode]; + return $this->newHydrator($hydrationMode); } /**