<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * ThdImage filter form base class.
 *
 * @package    filters
 * @subpackage ThdImage *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseThdImageFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'file'    => new sfWidgetFormFilterInput(),
      'film_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdFilm', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'file'    => new sfValidatorPass(array('required' => false)),
      'film_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'ThdFilm', 'column' => 'id')),
    ));

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

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

    parent::setup();
  }

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

  public function getFields()
  {
    return array(
      'id'      => 'Number',
      'file'    => 'Text',
      'film_id' => 'ForeignKey',
    );
  }
}