开发者

Set default date for created_at and updated_at fields in a Doctrine form

I have a symfony form which have crea开发者_开发问答ted_at and updated_at field for date. But I want to populate this field with default value and not shown when the form shows. So that, the created_at will hold the current time when inserting new data and updated_at will hold current date when updating any data.


These fields are automatically handled by propel. Simply unset() the fields in the form, and let propel do the magic :)

If you're using doctrine, add the Timestampable behavior to your class and unset the fields in the form, and it'll work too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜