[DDC-1479] GH-169: preFlush event and lifecycle callback Created: 08/Nov/11  Updated: 10/Jul/12  Resolved: 13/Nov/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/169

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()` call (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.

Comment by Benjamin Eberlei [ 13/Nov/11 ]

Merged into master

Comment by Benjamin Eberlei [ 09/Jul/12 ]

A related Github Pull-Request [GH-169] was opened

Comment by Benjamin Eberlei [ 10/Jul/12 ]

A related Github Pull-Request [GH-169] was closed

Generated at Wed Nov 25 09:38:19 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.