Commit 097d1d6b authored by romanb's avatar romanb

[2.0] Fixed _doMerge not to use hydrateAdd.

parent 731c9718
...@@ -157,7 +157,7 @@ class StandardEntityPersister ...@@ -157,7 +157,7 @@ class StandardEntityPersister
} }
} }
} }
$stmt->execute(); $stmt->execute();
if ($isPostInsertId) { if ($isPostInsertId) {
......
...@@ -1376,11 +1376,11 @@ class UnitOfWork implements PropertyChangedListener ...@@ -1376,11 +1376,11 @@ class UnitOfWork implements PropertyChangedListener
} }
} }
if ($class->isChangeTrackingNotify()) { if ($class->isChangeTrackingNotify()) {
//TODO //TODO: put changed fields in changeset...?
} }
} }
if ($class->isChangeTrackingDeferredExplicit()) { if ($class->isChangeTrackingDeferredExplicit()) {
//TODO //TODO: Mark $managedCopy for dirty check...? ($this->_scheduledForDirtyCheck)
} }
} }
...@@ -1389,8 +1389,12 @@ class UnitOfWork implements PropertyChangedListener ...@@ -1389,8 +1389,12 @@ class UnitOfWork implements PropertyChangedListener
$prevClass = $this->_em->getClassMetadata(get_class($prevManagedCopy)); $prevClass = $this->_em->getClassMetadata(get_class($prevManagedCopy));
if ($assoc->isOneToOne()) { if ($assoc->isOneToOne()) {
$prevClass->reflFields[$assocField]->setValue($prevManagedCopy, $managedCopy); $prevClass->reflFields[$assocField]->setValue($prevManagedCopy, $managedCopy);
//TODO: What about back-reference if bidirectional?
} else { } else {
$prevClass->reflFields[$assocField]->getValue($prevManagedCopy)->hydrateAdd($managedCopy); $prevClass->reflFields[$assocField]->getValue($prevManagedCopy)->unwrap()->add($managedCopy);
if ($assoc->isOneToMany()) {
$class->reflFields[$assoc->mappedByFieldName]->setValue($managedCopy, $prevManagedCopy);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment