root 10 anni fa
parent
commit
2fc61f18a2

+ 1 - 2
lib/Doctrine/ORM/EntityManager.php

@@ -352,8 +352,7 @@ class EntityManager implements ObjectManager
     {
         $this->errorIfClosed();
 
-	if(!is_null($entity))
-		$this->unitOfWork->commit($entity);
+	$this->unitOfWork->commit($entity);
     }
 
     /**

+ 2 - 1
lib/Doctrine/ORM/Persisters/BasicEntityPersister.php

@@ -548,7 +548,8 @@ class BasicEntityPersister
                     } else if ($targetClass->containsForeignIdentifier) {
                         $result[$owningTable][$sourceColumn] = $newValId[$targetClass->getFieldForColumn($targetColumn)];
                     } else {
-                        $result[$owningTable][$sourceColumn] = $newValId[$targetClass->fieldNames[$targetColumn]];
+                        if(isset($newValId[$targetClass->fieldNames[$targetColumn]]))
+				$result[$owningTable][$sourceColumn] = $newValId[$targetClass->fieldNames[$targetColumn]];
                     }
 
                     $this->_columnTypes[$sourceColumn] = $targetClass->getTypeOfColumn($targetColumn);