diff -r 56befcb22751 -r 94a1dc255022 thd/lib/form/doctrine/base/BaseThdSegmentForm.class.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thd/lib/form/doctrine/base/BaseThdSegmentForm.class.php Tue Sep 22 16:40:38 2009 +0200 @@ -0,0 +1,46 @@ +setWidgets(array( + 'id' => new sfWidgetFormInputHidden(), + 'title' => new sfWidgetFormInput(), + 'video_ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdVideo', 'add_empty' => false)), + 'start' => new sfWidgetFormInput(), + 'end' => new sfWidgetFormInput(), + 'user_id' => new sfWidgetFormInput(), + 'creation_date' => new sfWidgetFormDateTime(), + )); + + $this->setValidators(array( + 'id' => new sfValidatorDoctrineChoice(array('model' => 'ThdSegment', 'column' => 'id', 'required' => false)), + 'title' => new sfValidatorString(array('max_length' => 255)), + 'video_ref' => new sfValidatorDoctrineChoice(array('model' => 'ThdVideo')), + 'start' => new sfValidatorNumber(), + 'end' => new sfValidatorNumber(), + 'user_id' => new sfValidatorInteger(), + 'creation_date' => new sfValidatorDateTime(), + )); + + $this->widgetSchema->setNameFormat('thd_segment[%s]'); + + $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); + + parent::setup(); + } + + public function getModelName() + { + return 'ThdSegment'; + } + +}