Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Hydrators to be per-query instances instead of a singleton-like approach #738

Merged
merged 2 commits into from
Jul 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,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
);

Expand Down
15 changes: 3 additions & 12 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@
*/
private $eventManager;

/**
* The maintained (cached) hydrators. One instance per type.
*
* @var array
*/
private $hydrators = array();

/**
* The proxy factory used to create dynamic proxies.
*
Expand Down Expand Up @@ -840,17 +833,15 @@ 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);
}

/**
Expand Down