<?php

/**
 * CatProduct form base class.
 *
 * @method CatProduct 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 BaseCatProductForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cat_id'     => new sfWidgetFormInputHidden(array(), array()),
      'product_id' => new sfWidgetFormInputHidden(array(), array()),
    ));

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

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

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

    $this->setupInheritance();

    parent::setup();
  }

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

}
