1
0
mirror of synced 2025-01-18 22:41:43 +03:00

#1169 DDC-3343 - correcting one-to-many persister - association should not be updated directly if no orphan removal is involved

This commit is contained in:
Marco Pivetta 2015-01-27 06:27:37 +01:00
parent 539c364ca6
commit 9eaac13615

View File

@ -157,11 +157,17 @@ class OneToManyPersister extends AbstractCollectionPersister
*/
public function removeElement(PersistentCollection $collection, $element)
{
$mapping = $collection->getMapping();
if ( ! $mapping['orphanRemoval']) {
// no-op: this is not the owning side, therefore no operations should be applied
return false;
}
if ( ! $this->isValidEntityState($element)) {
return false;
}
$mapping = $collection->getMapping();
$persister = $this->uow->getEntityPersister($mapping['targetEntity']);
$targetMetadata = $this->em->getClassMetadata($mapping['targetEntity']);