<?php

/**
 * MailTemplate filter form base class.
 *
 * @package    sf
 * @subpackage filter
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseMailTemplateFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'title'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'event'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'theme'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'copy'   => new sfWidgetFormFilterInput(),
      'params' => new sfWidgetFormFilterInput(),
      'body'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'title'  => new sfValidatorPass(array('required' => false)),
      'event'  => new sfValidatorPass(array('required' => false)),
      'theme'  => new sfValidatorPass(array('required' => false)),
      'copy'   => new sfValidatorPass(array('required' => false)),
      'params' => new sfValidatorPass(array('required' => false)),
      'body'   => new sfValidatorPass(array('required' => false)),
    ));

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

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

    $this->setupInheritance();

    parent::setup();
  }

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

  public function getFields()
  {
    return array(
      'id'     => 'Number',
      'title'  => 'Text',
      'event'  => 'Text',
      'theme'  => 'Text',
      'copy'   => 'Text',
      'params' => 'Text',
      'body'   => 'Text',
    );
  }
}
