[DDC-2200] Duplicates returned while accessing associations from @PostPersist callback Created: 15/Dec/12 Updated: 15/Dec/12
|Project:||Doctrine 2 - ORM|
When creating a new Post and adding it to a collection in an existing Thread (i.e. loaded from the database), referencing Thread's posts collection in Post's @PostPersist callback returns the Post twice. To clarify, this only happens when Thread was previously persisted. If I'm creating a new Thread object the code works as expected. I've included some sample code to better illustrate my issue.
I don't know if this is a bug, or if I'm doing something that I shouldn't be, but I couldn't find this limitation mentioned in the documentation, and this seems to go against the expected behavior.
Here are my sample entities:
And the calling code: