1
0
mirror of synced 2024-12-13 06:46:03 +03:00

Simplify condition of previous commit (5cdc73e)

This commit is contained in:
Benjamin Eberlei 2013-05-01 10:58:44 +02:00
parent 760aaa67c4
commit 6505c96ec4

View File

@ -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 {