-
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
How to recompute collections in onFlush event? #7685
Comments
Can you please describe your use case in form of code and your complex associations? It sounds like you're having a use case that |
Sure, here is the code which made changes to collection. I'm awaiting clearing collection cache in
so, only manual clearing is supported. |
I have to take a look and run your example code on a current version. It looks like it follows the description mentioned in the docs https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/events.html#onflush. |
@wtorsi I'm able to make one of my example work, but this can be because I miss something that results in this mentioned break in your project. Can you please create a PR with a failing test to make this reproducible? |
Hi,
How to recompute changes made for association in onFlush event?
At this moment, i see only one possible solution is to call
computeChangeSet
on changed parent entity.But this solution will break when for example parent entity has
STATE_NEW
, all initial changes will be overwritten.Documented
recomputeSingleEntityChangeSet
skips complex associations.The text was updated successfully, but these errors were encountered: