From 9c9f85ed4b78218844a45d52d2e37613fb1e77f5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 9 Nov 2011 22:13:06 +0100 Subject: [PATCH] Only refresh the given entity if an entity is specified in the query hints --- lib/Doctrine/ORM/UnitOfWork.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index fab0df4a1..11280b597 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -2195,6 +2195,11 @@ class UnitOfWork implements PropertyChangedListener } } else { $overrideLocalValues = isset($hints[Query::HINT_REFRESH]); + + // If a only a specific entity is set to refresh, check that it's the one + if(isset($hints[Query::HINT_REFRESH_ENTITY])) { + $overrideLocalValues = $hints[Query::HINT_REFRESH_ENTITY] === $entity; + } } if ($overrideLocalValues) {