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

#1169 DDC-3343 - one-to-many extra-lazy should not delete associated values when they are removed, but just update the owning side

This commit is contained in:
Marco Pivetta 2015-01-24 11:40:48 +01:00
parent c2b3348f99
commit f184956d3a

View File

@ -163,7 +163,14 @@ class OneToManyPersister extends AbstractCollectionPersister
$mapping = $collection->getMapping();
$persister = $this->uow->getEntityPersister($mapping['targetEntity']);
return $persister->delete($element);
$targetMetadata = $this->em->getClassMetadata($mapping['targetEntity']);
// clearing owning side value
$targetMetadata->reflFields[$mapping['mappedBy']]->setValue($element, null);
$persister->update($element);
return true;
}
/**