<?php

/**
 * Repository filter form base class.
 *
 * @package    crew
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseRepositoryFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'name'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'value'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'remote' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'name'   => new sfValidatorPass(array('required' => false)),
      'value'  => new sfValidatorPass(array('required' => false)),
      'remote' => new sfValidatorPass(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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

  public function getFields()
  {
    return array(
      'id'     => 'Number',
      'name'   => 'Text',
      'value'  => 'Text',
      'remote' => 'Text',
    );
  }
}
