mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2704: When using Discriminator EntityManager#merge fails #3386
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 (Sep 25, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user vladykx:
I have the following hierarchy:
I believe the problem is because of the following:
UnitOfWork#doMerge has the tries to get properties the following way:
This obviously doesn't get the parent class (AgentTask) properties.
Later on UnitOfWork fails on line:
because $prevManagedCopy doesn't have properties set from entity.
My proposal is to get the properties the following way:
@doctrinebot commented on GitHub (Sep 25, 2013):
@doctrinebot commented on GitHub (Jan 20, 2015):
Comment created by rkj:
I have this problem as well in .
The Merge operation does not copy properties of any parent class to the managed copy. My workaround when merging entities with inheritance is:
This is obviously only manageable with a relatively simple datastructure, and quickly becomes very messy with more complex entities and relationship hierarchies.
Would really appreciate a fix for this
@doctrinebot commented on GitHub (Jan 20, 2015):
Comment created by @ocramius:
A temporary workaround is to change properties into protected. I'll mark this for 2.5 and see if it can be fixed by then.
@doctrinebot commented on GitHub (Jan 25, 2015):
Comment created by @ocramius:
Handled in DDC-3524
@doctrinebot commented on GitHub (Jan 25, 2015):
Issue was closed with resolution "Fixed"