My doctrine entity has a datetime
property called updated
. This should get the current time everytime (changed) values of the object are written to the DB. I know how to do this in MySql, but I'm looking for a doctrine/symfony solution.
Is there a way to
- hook into something before an INSERT/UPDATE of an instance is sent to the DB.
- update the
updated
property to the current time and make sure it's written to the DB without triggering a second UPDATE statement.