1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| $this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'contact_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('contact'), 'add_empty' => true)),
'etio_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etio'), 'add_empty' => false)),
'content' => new sfWidgetFormTextarea(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'contact_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('contact'), 'required' => false)),
'etio_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etio'))),
'content' => new sfValidatorString(array('max_length' => 20000, 'required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
)); |
Partager