Symfony 1.4 – Doctrine Timestampable Behaviour
Recently Symfony released their LTS 1.4 branch. Unlike previous versions Symfony 1.4 comes with Doctrine as default ORM. If you have worked with Doctrine’s you will be familiar with its Timestampable behavior.
actAs: Timestampable: ~
Timestampable behavior automatically adds a created_at and updated_at column and automatically set the values when a record is inserted and updated. I mostly use Symfony Admin Generator to generate Backend. This behavior worked fined till Symfony 1.2, but in Symfony 1.3 / 1.4 for unknown reasons this behavior adds created_at and updated_at fields as required and their value must be filled during creation of new record in admin generator.
To fix this issue open your formClass located at
lib/form/doctrine/yourClassForm.Class.php
replace yourClass with actuall class name
and add following code in configure function.
public function configure()
{
//Following code will remove Required validators from these fields.
unset($this->validatorSchema['created_at']);
unset($this->validatorSchema['updated_at']);
//following code will remove fields from form
unset($this->widgetSchema['created_at']);
unset($this->widgetSchema['updated_at']);
}
Hope this help
You should read

rdcklinux on February 13th, 2010 at 1:54 AM
if you write
unset($this['created_at'],$this['updated_at']);
it is the same!!