<?php

/**
 * ThdFilm form base class.
 *
 * @package    form
 * @subpackage thd_film
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseThdFilmForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'ref'                  => new sfWidgetFormInput(),
      'title'                => new sfWidgetFormInput(),
      'pitch'                => new sfWidgetFormTextarea(),
      'duration'             => new sfWidgetFormInput(),
      'directors'            => new sfWidgetFormTextarea(),
      'actors'               => new sfWidgetFormTextarea(),
      'slug_url'             => new sfWidgetFormInput(),
      'original_title'       => new sfWidgetFormInput(),
      'production_countries' => new sfWidgetFormTextarea(),
      'production_year'      => new sfWidgetFormInput(),
      'uniqueid'             => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm', 'column' => 'id', 'required' => false)),
      'ref'                  => new sfValidatorString(array('max_length' => 255)),
      '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_countries' => new sfValidatorString(array('max_length' => 2147483647)),
      'production_year'      => new sfValidatorInteger(array('required' => false)),
      'uniqueid'             => new sfValidatorString(array('max_length' => 36)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'ThdFilm', 'column' => array('uniqueid')))
    );

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

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

    parent::setup();
  }

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

}
