Doctrine - Add default time stamp to entity like NOW()
问题 Following the Doctrine guidelines I understand how to set a default value for an Entity, but what if I wanted a date/time stamp? http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/faq.html My problem is my database has a default of NOW() on a field but when I use Doctrine to insert a record the values are null or blank but the rest of the insert happened. Also since Doctrine says to declare the default as a const, this also creates a problem. Suggestions? 回答1: Ok I found