<?php

/**
 * Export form base class.
 *
 * @method Export getObject() Returns the current form's model object
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseExportForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(array(), array("autocomplete" => "off")),
      'logic_type' => new sfWidgetFormChoice(array('choices' => array('bid' => 'bid', 'wait' => 'wait', 'bid_after_wait' => 'bid_after_wait')), array("autocomplete" => "off")),
      'cat_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cat'), 'add_empty' => true), array("autocomplete" => "off")),
      'weight'     => new sfWidgetFormInputText(array(), array("autocomplete" => "off", "size" => 10, "maxlength" => 10)),
      'sum'        => new sfWidgetFormInputText(array(), array("autocomplete" => "off", "size" => 10, "maxlength" => 10)),
      'user_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true), array("autocomplete" => "off")),
      'created_at' => new sfWidgetFormDateTime(array(), array("autocomplete" => "off", "required" => true)),
      'updated_at' => new sfWidgetFormDateTime(array(), array("autocomplete" => "off", "required" => true)),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'logic_type' => new sfValidatorChoice(array('choices' => array(0 => 'bid', 1 => 'wait', 2 => 'bid_after_wait'), 'required' => false)),
      'cat_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cat'), 'required' => false)),
      'weight'     => new sfValidatorNumber(array('required' => false)),
      'sum'        => new sfValidatorNumber(array('required' => false)),
      'user_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'required' => false)),
      'created_at' => new sfValidatorDateTime(),
      'updated_at' => new sfValidatorDateTime(),
    ));

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

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

    $this->setupInheritance();

    parent::setup();
  }

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

}
