From 29bf4adac759b5d3ab95da650f226afe69f690c0 Mon Sep 17 00:00:00 2001 From: "Roman S. Borschel" Date: Sat, 7 Aug 2010 11:33:33 +0200 Subject: [PATCH] Fixed merging issue with sequence identifiers. --- lib/Doctrine/ORM/UnitOfWork.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 50852ac36..2008cbe53 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1405,7 +1405,9 @@ class UnitOfWork implements PropertyChangedListener // Merge state of $entity into existing (managed) entity foreach ($class->reflFields as $name => $prop) { if ( ! isset($class->associationMappings[$name])) { - $prop->setValue($managedCopy, $prop->getValue($entity)); + if ( ! $class->isIdentifier($name)) { + $prop->setValue($managedCopy, $prop->getValue($entity)); + } } else { $assoc2 = $class->associationMappings[$name]; if ($assoc2->isOneToOne()) {