tamir
tamir

Reputation: 3297

Doctrine 2 PreInsert equivalent?

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!

Upvotes: 0

Views: 1745

Answers (1)

rojoca
rojoca

Reputation: 11190

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

Upvotes: 6

Related Questions