Modified Hydrators to be per-query instances instead of a singleton-like approach.
This commit is contained in:
parent
ec36e2c866
commit
453a56670d
@ -799,7 +799,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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -221,14 +221,6 @@ abstract class EntityManagerDecorator extends ObjectManagerDecorator implements
|
|||||||
return $this->wrapped->getUnitOfWork();
|
return $this->wrapped->getUnitOfWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getHydrator($hydrationMode)
|
|
||||||
{
|
|
||||||
return $this->wrapped->getHydrator($hydrationMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -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.
|
||||||
*
|
*
|
||||||
@ -834,25 +827,6 @@ use Doctrine\Common\Util\ClassUtils;
|
|||||||
return $this->unitOfWork;
|
return $this->unitOfWork;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a hydrator for the given hydration mode.
|
|
||||||
*
|
|
||||||
* This method caches the hydrator instances which is used for all queries that don't
|
|
||||||
* selectively iterate over the result.
|
|
||||||
*
|
|
||||||
* @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];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance for the given hydration mode.
|
* Create a new instance for the given hydration mode.
|
||||||
*
|
*
|
||||||
|
@ -51,7 +51,6 @@ interface EntityManagerInterface extends ObjectManager
|
|||||||
public function getConfiguration();
|
public function getConfiguration();
|
||||||
public function isOpen();
|
public function isOpen();
|
||||||
public function getUnitOfWork();
|
public function getUnitOfWork();
|
||||||
public function getHydrator($hydrationMode);
|
|
||||||
public function newHydrator($hydrationMode);
|
public function newHydrator($hydrationMode);
|
||||||
public function getProxyFactory();
|
public function getProxyFactory();
|
||||||
public function getFilters();
|
public function getFilters();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user