<?php

/**
 * Keyword form base class.
 *
 * @method Keyword 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 BaseKeywordForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'   => new sfWidgetFormInputHidden(array(), array()),
      'word' => new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true)),
      'rank' => new sfWidgetFormInputText(array(), array("size" => 8, "maxlength" => 8)),
      'ids'  => new sfWidgetFormTextarea(array(), array("rows" => 5, "cols" => 70)),
    ));

    $this->setValidators(array(
      'id'   => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'word' => new sfValidatorString(array('max_length' => 255)),
      'rank' => new sfValidatorInteger(array('required' => false)),
      'ids'  => new sfValidatorString(array('required' => false)),
    ));

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

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

    $this->setupInheritance();

    parent::setup();
  }

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

}
