Jira issue originally created by user strate:
preFlush event called multiple times inside event manager when flushing more than one entity.
Comment created by @beberlei:
preFlush is called for every entity, you can retrieve the entity affected by using "getEntity()" on the event arguments. Use "onFlush" to get an evvent that is only called once.
Comment created by strate:
Ok, the problem is as it seems, there is a "preFlush" lifecycle event that is called for every entity, but also a preFlush listener event that isonly called once. I didn't know that there were sementical differences between them. This indeed needs to be fixed.
Fix provided here: #887
Comment created by @doctrinebot:
A related Github Pull-Request [GH-887] was closed:
Issue was closed with resolution "Duplicate"