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:
commit
8d13601e39
@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -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];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user