I understand there is no PreInsert listener in Doctrine2, right? Is the equivalnet PrePersist? And if so, how do I check if the object is being inserted or updated?
Thanks!
I understand there is no PreInsert listener in Doctrine2, right? Is the equivalnet PrePersist? And if so, how do I check if the object is being inserted or updated?
Thanks!
For all intents and purposes PrePersist is PreInsert. it will not be called for entities that are only updated - you can use PreUpdate for that.
Here are the relevant docs: http://www.doctrine-project.org/docs/orm/2.1/en/reference/events.html#prepersist