Skip to content
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

Empty ManyToMany collection after refresh inside PostPersist event #8616

Open
jsakars opened this issue Apr 12, 2021 · 0 comments
Open

Empty ManyToMany collection after refresh inside PostPersist event #8616

jsakars opened this issue Apr 12, 2021 · 0 comments

Comments

@jsakars
Copy link

jsakars commented Apr 12, 2021

Using v2.7.3 of this library, I have a following case:

  • I have an entity (e.g. Book) for which some DB value (number) is calculated using DB trigger => therefore I need to refresh the entity during PostPersist event in order to have the value available further down the path (e.g. to have it indexed in the Elasticsearch)
  • I also have a ManyToMany Collection (e.g. Author) => for example one Author can have multiple Books and vice versa
  • the problem is that after doing the $em->refresh($book) within PostPersist Listener -> $authors collection is empty even though there are actual entries of course stored in the database even

Of course, I do have several 3rd party libraries (Gedmo Translatable, Blamable etc.) used which might have something to do with this.

What could be the cause of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant