mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1425: Strange behaviour of EntityManager::merge and EntityManager::remove methods when a cascading delete constraint is declared #1787
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 (Oct 16, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user dalvarez:
Here is an isolated test to illustrate some IMO ill behaviour of the EntityManager::merge and EntityManager::remove methods, which is a side observation of another test case I am writing. I cannot explain why this should not work. Please have a look.
Here are two test entities:
Here is the test code, starting from a configured entity manager (which needs to be initialized according to your setup):
@doctrinebot commented on GitHub (Oct 16, 2011):
Comment created by dalvarez:
Duh!...
Just realized the merge method does not work by reference. I should have better saved the return value...
Sometimes problems have simple solutions...
@doctrinebot commented on GitHub (Oct 16, 2011):
Comment created by dalvarez:
Just stupid.
@doctrinebot commented on GitHub (Oct 16, 2011):
Issue was closed with resolution "Invalid"