mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2528: Extracting entities through DQL query resets the previous associations #3171
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 24, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user legolas:
I have the entities Purchase(owning side) and Product(inverse side) sharing bidirectional many to many relation. Now whatever associations I build between product and purchase entity, those associations are erased if by mistake I happen to run a join query between the products and purchase table. For example look at this code.
As you can see, when I have added a new entity
$prodto the$purc, the number of products linked to$purcshould have increased to 3. It seems the join overrides the previous associations formed. More strange is if I had fetched the products related to$purcfrom the tables before the join query(the commented code before dql), then the last print statement would have given 3.I am facing a lot of similar issues.