mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3754: Entity cloning #4603
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 (Jun 3, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user mastir:
Sometimes doctrine query results proxy objects, even if them loaded directly. Proxy class overriding __clone method, so i can't reset id fields for it.I used another method "__clone_again_for_random_proxified_entity" to reset image id, but i'm sure its not the way this shuld work.
My code as example:
i wasted half of day to catch collction with proxified entity (i think its loaded some where before as a proxy and then initialized on query)
i think its easy to fix by adding parent::**clone call on a proxy objects and avoid this kind of bugs. Thanks.
@doctrinebot commented on GitHub (Jun 3, 2015):
Comment created by @ocramius:
parent::**cloneshould actually be in the proxies. If that's not the case, then please write a test case against https://github.com/doctrine/commonSee also
ff72726b08/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php (L216-L231)@doctrinebot commented on GitHub (Jun 3, 2015):
Comment created by mastir:
Manual proxy regeneration solved this problem. Thanks a lot.
@doctrinebot commented on GitHub (Jun 3, 2015):
Issue was closed with resolution "Invalid"