-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH11551 - fix OneToManyPersister::deleteEntityCollection case where single-inheritence table parent entity is targetEntity. #11564
Conversation
single-inheritence entity parent as targetEntity. When using the parent entity for a single-inheritence table as the targetEntity for a property, the discriminator value should be all of the values in the discriminator map. OneToManyPersister::deleteEntityCollection has been amended to reflect this.
$em->persist($testEntityHolder); | ||
$em->flush(); | ||
|
||
$testEntityHolder->testEntities = new ArrayCollection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you are only changing the inverse side of the relationship, right? With that in mind, and after reading this, I don't see why "All records should have been deleted". Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe.. unless I'm misunderstanding, I think that linked page is incomplete as it doesn't account for orphanRemoval. This suggests in that case the inverse side is not ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you're correct. Maybe that first page should be updated to account for that exception to the general rule?
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
Thanks @gitbugr ! |
Fixes #11551
When using the parent entity for a single-inheritence table as the targetEntity for a property, the discriminator value should be all of the values in the discriminator map.
OneToManyPersister::deleteEntityCollection has been amended to reflect this.