<?php

/**
 * NewsRate form base class.
 *
 * @method NewsRate getObject() Returns the current form's model object
 *
 * @package    mongolcom
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseNewsRateForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'      => new sfWidgetFormInputHidden(),
      'news_id' => new sfWidgetFormInputText(),
      'nb_rate' => new sfWidgetFormInputText(),
      'total'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'news_id' => new sfValidatorInteger(),
      'nb_rate' => new sfValidatorInteger(),
      'total'   => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('news_rate[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'NewsRate';
  }

}
