When does the Doctrine prePersist event run?
19 June 2024 (Updated 18 May 2025)
On this page
In a nutshell
The prePersist
event is dispatched just before Doctrine performs the actual persist operation (i.e., just before the entity is about to be inserted into the database).
Other notes
Doctrine will not recognize changes made to relations in the prePersist
event. This includes modifications to collections such as additions, removals, or replacements.
Sources
Tagged:
Doctrine