<?php

/**
 * CatParent form base class.
 *
 * @method CatParent 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 BaseCatParentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cat_id'    => new sfWidgetFormInputHidden(array(), array()),
      'parent_id' => new sfWidgetFormInputHidden(array(), array()),
      'order_id'  => new sfWidgetFormInputText(array(), array("size" => 8, "maxlength" => 8, "required" => true)),
    ));

    $this->setValidators(array(
      'cat_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'cat_id', 'required' => false)),
      'parent_id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'parent_id', 'required' => false)),
      'order_id'  => new sfValidatorInteger(array('required' => false)),
    ));

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

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

    $this->setupInheritance();

    parent::setup();
  }

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

}
