<?php

/**
 * ThdSegmentTag form base class.
 *
 * @package    form
 * @subpackage thd_segment_tag
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseThdSegmentTagForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'tag_id'     => new sfWidgetFormDoctrineChoice(array('model' => 'ThdTag', 'add_empty' => false)),
      'segment_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdSegment', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorDoctrineChoice(array('model' => 'ThdSegmentTag', 'column' => 'id', 'required' => false)),
      'tag_id'     => new sfValidatorDoctrineChoice(array('model' => 'ThdTag')),
      'segment_id' => new sfValidatorDoctrineChoice(array('model' => 'ThdSegment')),
    ));

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

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

    parent::setup();
  }

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

}
