From 5cf906d76b6ca3baf166a6eda4efcaea7b1a2fa9 Mon Sep 17 00:00:00 2001 From: flack Date: Fri, 2 May 2014 21:52:00 +0200 Subject: [PATCH] Remove some redundant clauses --- lib/Doctrine/ORM/UnitOfWork.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index fd21c99ca..25b657304 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -2553,12 +2553,6 @@ class UnitOfWork implements PropertyChangedListener if ($entity instanceof NotifyPropertyChanged) { $entity->addPropertyChangedListener($this); } - - // inject ObjectManager into just loaded proxies. - if ($overrideLocalValues && $entity instanceof ObjectManagerAware) { - $entity->injectObjectManager($this->em, $class); - } - } else { $overrideLocalValues = isset($hints[Query::HINT_REFRESH]); @@ -2566,14 +2560,14 @@ class UnitOfWork implements PropertyChangedListener if (isset($hints[Query::HINT_REFRESH_ENTITY])) { $overrideLocalValues = $hints[Query::HINT_REFRESH_ENTITY] === $entity; } - - // inject ObjectManager upon refresh. - if ($overrideLocalValues && $entity instanceof ObjectManagerAware) { - $entity->injectObjectManager($this->em, $class); - } } if ($overrideLocalValues) { + // inject ObjectManager upon refresh. + if ($entity instanceof ObjectManagerAware) { + $entity->injectObjectManager($this->em, $class); + } + $this->originalEntityData[$oid] = $data; } } else {