mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3382: [GH-1419] With orphanRemoval, cannot delete and re-add entity #4176
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 10, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user c960657:
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.
@doctrinebot commented on GitHub (Nov 10, 2014):
@doctrinebot commented on GitHub (Nov 10, 2014):
Comment created by @ocramius:
This is expected behavior, and won't be changed for now.
@doctrinebot commented on GitHub (Nov 10, 2014):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Feb 10, 2015):
Comment created by d.shashkin:
Is there any specific reason for this decision? Spent some time debugging because of this and I must say that such oddities are rather frustrating.
@doctrinebot commented on GitHub (Feb 10, 2015):
Comment created by @ocramius:
[~d.shashkin] we currently don't have an operation opposite to
orphanRemoval@doctrinebot commented on GitHub (Jun 11, 2015):
Comment created by c960657:
I have made a PR with the suggested change. It is a very small fix, so I hope you will reconsider this suggestion in the light of this.
https://github.com/doctrine/doctrine2/pull/1419
@doctrinebot commented on GitHub (Jun 16, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1419] was merged:
https://github.com/doctrine/doctrine2/pull/1419