thd/lib/form/doctrine/base/BaseThdFilmForm.class.php
changeset 104 8e4fe6f3337d
parent 103 d2af8a210f5d
child 105 c8f710cd1fb1
equal deleted inserted replaced
103:d2af8a210f5d 104:8e4fe6f3337d
     1 <?php
       
     2 
       
     3 /**
       
     4  * ThdFilm form base class.
       
     5  *
       
     6  * @package    form
       
     7  * @subpackage thd_film
       
     8  * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
       
     9  */
       
    10 class BaseThdFilmForm extends BaseFormDoctrine
       
    11 {
       
    12   public function setup()
       
    13   {
       
    14     $this->setWidgets(array(
       
    15       'id'              => new sfWidgetFormInputHidden(),
       
    16       'ref'             => new sfWidgetFormDoctrineChoice(array('model' => 'ThdImage', 'add_empty' => false)),
       
    17       'title'           => new sfWidgetFormInput(),
       
    18       'pitch'           => new sfWidgetFormTextarea(),
       
    19       'duration'        => new sfWidgetFormInput(),
       
    20       'directors'       => new sfWidgetFormTextarea(),
       
    21       'actors'          => new sfWidgetFormTextarea(),
       
    22       'slug_url'        => new sfWidgetFormInput(),
       
    23       'original_title'  => new sfWidgetFormInput(),
       
    24       'production_year' => new sfWidgetFormInput(),
       
    25     ));
       
    26 
       
    27     $this->setValidators(array(
       
    28       'id'              => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm', 'column' => 'id', 'required' => false)),
       
    29       'ref'             => new sfValidatorDoctrineChoice(array('model' => 'ThdImage')),
       
    30       'title'           => new sfValidatorString(array('max_length' => 255)),
       
    31       'pitch'           => new sfValidatorString(array('max_length' => 2147483647)),
       
    32       'duration'        => new sfValidatorInteger(),
       
    33       'directors'       => new sfValidatorString(array('max_length' => 2147483647)),
       
    34       'actors'          => new sfValidatorString(array('max_length' => 2147483647)),
       
    35       'slug_url'        => new sfValidatorString(array('max_length' => 255)),
       
    36       'original_title'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
       
    37       'production_year' => new sfValidatorInteger(array('required' => false)),
       
    38     ));
       
    39 
       
    40     $this->widgetSchema->setNameFormat('thd_film[%s]');
       
    41 
       
    42     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
       
    43 
       
    44     parent::setup();
       
    45   }
       
    46 
       
    47   public function getModelName()
       
    48   {
       
    49     return 'ThdFilm';
       
    50   }
       
    51 
       
    52 }