From 6505c96ec47538f24f460adf5af8298e7e0de112 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 1 May 2013 10:58:44 +0200 Subject: [PATCH] Simplify condition of previous commit (5cdc73e) --- lib/Doctrine/ORM/UnitOfWork.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 4744a005d..c1065dba2 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1851,7 +1851,7 @@ class UnitOfWork implements PropertyChangedListener // do not merge fields marked lazy that have not been fetched. continue; } else if ( ! $assoc2['isCascadeMerge']) { - if (($otherState = $this->getEntityState($other)) !== self::STATE_MANAGED && $otherState !== self::STATE_NEW) { + if ($this->getEntityState($other) === self::STATE_DETACHED) { $targetClass = $this->em->getClassMetadata($assoc2['targetEntity']); $relatedId = $targetClass->getIdentifierValues($other); @@ -1862,6 +1862,7 @@ class UnitOfWork implements PropertyChangedListener $this->registerManaged($other, $relatedId, array()); } } + $prop->setValue($managedCopy, $other); } } else {