You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a one-to-many relation with orphanRemoval=true.
If I remove an entity from the related collection and add it back, the entity is removed from the database.
$employee = $company->getEmployees()->first();
$company->getEmployees()->removeElement($employee);
$company->getEmployees()->add($employee);
$em->persist($company);
$em->flush();
// Now $employee is deleted from the database.
The expected behaviour is to leave the entity in the database, because it was present in the PersistentCollection when $em->persist() was called.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of c960657:
Url: #1419
Message:
I have a one-to-many relation with orphanRemoval=true.
If I remove an entity from the related collection and add it back, the entity is removed from the database.
The expected behaviour is to leave the entity in the database, because it was present in the PersistentCollection when $em->persist() was called.
This has previously been suggested in [DDC-3382](http://www.doctrine-project.org/jira/browse/[DDC-3382]%28http://www.doctrine-project.org/jira/browse/DDC-3382%29), but it was rejected. This PR shows how small a change it is, so I hope the suggestion will be reconsidered in the light of this.
The text was updated successfully, but these errors were encountered: