thd/lib/form/doctrine/base/BaseThdVideoForm.class.php
changeset 35 94a1dc255022
equal deleted inserted replaced
34:56befcb22751 35:94a1dc255022
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * ThdVideo form base class.
       
     5  *
       
     6  * @package    form
       
     7  * @subpackage thd_video
       
     8  * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
       
     9  */
       
    10 class BaseThdVideoForm extends BaseFormDoctrine
       
    11 {
       
    12   public function setup()
       
    13   {
       
    14     $this->setWidgets(array(
       
    15       'id'       => new sfWidgetFormInputHidden(),
       
    16       'ref'      => new sfWidgetFormDoctrineChoice(array('model' => 'ThdSegment', 'add_empty' => false)),
       
    17       'film_ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdFilm', 'add_empty' => false)),
       
    18       'file'     => new sfWidgetFormInput(),
       
    19       'title'    => new sfWidgetFormInput(),
       
    20     ));
       
    21 
       
    22     $this->setValidators(array(
       
    23       'id'       => new sfValidatorDoctrineChoice(array('model' => 'ThdVideo', 'column' => 'id', 'required' => false)),
       
    24       'ref'      => new sfValidatorDoctrineChoice(array('model' => 'ThdSegment')),
       
    25       'film_ref' => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm')),
       
    26       'file'     => new sfValidatorString(array('max_length' => 255)),
       
    27       'title'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
       
    28     ));
       
    29 
       
    30     $this->widgetSchema->setNameFormat('thd_video[%s]');
       
    31 
       
    32     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
       
    33 
       
    34     parent::setup();
       
    35   }
       
    36 
       
    37   public function getModelName()
       
    38   {
       
    39     return 'ThdVideo';
       
    40   }
       
    41 
       
    42 }