diff -r 56befcb22751 -r 94a1dc255022 thd/lib/form/doctrine/base/BaseThdImageForm.class.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thd/lib/form/doctrine/base/BaseThdImageForm.class.php Tue Sep 22 16:40:38 2009 +0200 @@ -0,0 +1,40 @@ +setWidgets(array( + 'id' => new sfWidgetFormInputHidden(), + 'film_ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdFilm', 'add_empty' => false)), + 'type' => new sfWidgetFormInput(), + 'file' => new sfWidgetFormInput(), + )); + + $this->setValidators(array( + 'id' => new sfValidatorDoctrineChoice(array('model' => 'ThdImage', 'column' => 'id', 'required' => false)), + 'film_ref' => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm')), + 'type' => new sfValidatorInteger(), + 'file' => new sfValidatorString(array('max_length' => 255)), + )); + + $this->widgetSchema->setNameFormat('thd_image[%s]'); + + $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); + + parent::setup(); + } + + public function getModelName() + { + return 'ThdImage'; + } + +}