mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2598: Entity removal not persisted when orphanRemoval set to false #3261
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 (Aug 7, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user sparrow:
I have a User class related to UserRole class. The second one is in relations with other entities also.
When I remove a UserRole from collection like below the removal is not persisted to the database unless I specify the orphanRemoval to true (on its mapping).
This seems weird because this is not the case of a User removal but the related UserRole. I think it is because the UserRole is in relation to other Entities which makes doctrine think I might be necessary to keep it in database.
@doctrinebot commented on GitHub (Aug 7, 2013):
Comment created by @ocramius:
Removing an entity from an association has nothing to do with deleting it.
That's exactly what orphan removal achieves instead.
Additionally, in your example, you are not updating the owning side of the association when dissociating users from roles
@doctrinebot commented on GitHub (Aug 7, 2013):
Issue was closed with resolution "Invalid"