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