0

I need create another new Entity in entity preFlush event in case when current entity was changed. In preFlush I don't have computed change set, if I trigger compute change set, to avoid infinite loop preFlush listener should be disabled. How can I do that? Does another solution to know if entity was really changed exists?

Alexander
  • 450
  • 1
  • 4
  • 12
  • `preFlush` is probably not the way to go in such case (This event is not a lifecycle callback). `preUpdate` sounds more like what you need... – Wilt Jan 14 '16 at 14:06
  • @Wilt ok, looks like I should use preUpdate, but create new entity there is imposible, any ideas? – Alexander Jan 14 '16 at 14:30
  • Check [here](http://stackoverflow.com/a/16906067/1697459) – Wilt Jan 14 '16 at 14:33
  • there is no entity postFlush event – Alexander Jan 14 '16 at 15:39
  • Check [the docs](http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/events.html#lifecycle-events): *postFlush - The postFlush event occurs at the end of a flush operation. This event is not a lifecycle callback* – Wilt Jan 14 '16 at 15:41

0 Answers0