<?php

/**
 * ConfDialplanCounternode form base class.
 *
 * @package    form
 * @subpackage conf_dialplan_counternode
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseConfDialplanCounternodeForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'dbid'             => new sfWidgetFormInputHidden(),
      'startat'          => new sfWidgetFormInput(),
      'increment'        => new sfWidgetFormInput(),
      'dialplan_node_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ConfDialplanNode', 'add_empty' => true)),
      'countername'      => new sfWidgetFormInput(),
      'maxvalue'         => new sfWidgetFormInput(),
      'onnext'           => new sfWidgetFormInput(),
      'onmaxvalue'       => new sfWidgetFormInput(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'dbid'             => new sfValidatorDoctrineChoice(array('model' => 'ConfDialplanCounternode', 'column' => 'dbid', 'required' => false)),
      'startat'          => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'increment'        => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'dialplan_node_id' => new sfValidatorDoctrineChoice(array('model' => 'ConfDialplanNode', 'required' => false)),
      'countername'      => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'maxvalue'         => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'onnext'           => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'onmaxvalue'       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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

}
