<?php

/**
 * ThdTag form base class.
 *
 * @package    form
 * @subpackage thd_tag
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseThdTagForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'       => new sfWidgetFormInputHidden(),
      'tag'      => new sfWidgetFormInput(),
      'uniqueid' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'       => new sfValidatorDoctrineChoice(array('model' => 'ThdTag', 'column' => 'id', 'required' => false)),
      'tag'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'uniqueid' => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'ThdTag', 'column' => array('uniqueid')))
    );

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

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

    parent::setup();
  }

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

}
