#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:
parent
c2b3348f99
commit
f184956d3a
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue