diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 583969944..07b6b9ea9 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -799,7 +799,7 @@ abstract class AbstractQuery 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 acaec984d..d21d3fb86 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -99,13 +99,6 @@ use Doctrine\Common\Util\ClassUtils; */ private $eventManager; - /** - * The maintained (cached) hydrators. One instance per type. - * - * @var array - */ - private $hydrators = array(); - /** * The proxy factory used to create dynamic proxies. * @@ -840,17 +833,15 @@ use Doctrine\Common\Util\ClassUtils; * 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); } /**