<?php

/**
 * ThdVideo form base class.
 *
 * @package    form
 * @subpackage thd_video
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseThdVideoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'      => new sfWidgetFormInputHidden(),
      'file'    => new sfWidgetFormInput(),
      'title'   => new sfWidgetFormInput(),
      'film_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdFilm', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'      => new sfValidatorDoctrineChoice(array('model' => 'ThdVideo', 'column' => 'id', 'required' => false)),
      'file'    => new sfValidatorString(array('max_length' => 255)),
      'title'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'film_id' => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm')),
    ));

    $this->widgetSchema->setNameFormat('thd_video[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ThdVideo';
  }

}
