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