mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #169] preFlush event and lifecycle callback #7813
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/169
State: closed
Merged: Yes
For now, we have
@PrePersist,@PreUpdateand@PreRemovecallbacks. But it's not enough, cuz in some cases we need to run some entity method just before everyEntityManager#flush()call (examples - translatable behavior and file uploading routines).I've added and tested new
@PreFlushevent, which occurs during the start of theEntityManager#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.