doctrine/doctrine2 — pull request #169 by everzet (2011-10-23 15:46:35+00:00)
Title: preFlush event and lifecycle callback

For now, we have `@PrePersist`, `@PreUpdate` and `@PreRemove` callbacks. But it's not enough, cuz in some cases we need to run some entity method just before **every** `EntityManager#flush()` (examples - translatable behavior and file uploading routines).

I've added and tested new `@PreFlush` event, which occurs during the start of the `EntityManager#flush()`, before any changeset gets calculated. This gives users ability to hook into flush process and prepare their entities to save even if they were not changed.