1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Merge pull request #738 from doctrine/VolatileQueryHydrators

Modified Hydrators to be per-query instances instead of a singleton-like approach
This commit is contained in:
Guilherme Blanco 2013-07-29 08:31:38 -07:00
commit 8d13601e39
2 changed files with 4 additions and 13 deletions

View File

@ -787,7 +787,7 @@ abstract class AbstractQuery
return $stmt; return $stmt;
} }
$data = $this->_em->getHydrator($this->_hydrationMode)->hydrateAll( $data = $this->_em->newHydrator($this->_hydrationMode)->hydrateAll(
$stmt, $this->_resultSetMapping, $this->_hints $stmt, $this->_resultSetMapping, $this->_hints
); );

View File

@ -99,13 +99,6 @@ use Doctrine\Common\Util\ClassUtils;
*/ */
private $eventManager; private $eventManager;
/**
* The maintained (cached) hydrators. One instance per type.
*
* @var array
*/
private $hydrators = array();
/** /**
* The proxy factory used to create dynamic proxies. * 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 * This method caches the hydrator instances which is used for all queries that don't
* selectively iterate over the result. * selectively iterate over the result.
* *
* @deprecated
*
* @param int $hydrationMode * @param int $hydrationMode
* *
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/ */
public function getHydrator($hydrationMode) public function getHydrator($hydrationMode)
{ {
if ( ! isset($this->hydrators[$hydrationMode])) { return $this->newHydrator($hydrationMode);
$this->hydrators[$hydrationMode] = $this->newHydrator($hydrationMode);
}
return $this->hydrators[$hydrationMode];
} }
/** /**