<?php

/**
 * Node form base class.
 *
 * @package    form
 * @subpackage node
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseNodeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'is_public'            => new sfWidgetFormInputCheckbox(),
      'node_class'           => new sfWidgetFormInput(),
      'url_provider'         => new sfWidgetFormInput(),
      'open_target_provider' => new sfWidgetFormInput(),
      'perms_type'           => new sfWidgetFormInput(),
      'credentials'          => new sfWidgetFormTextarea(),
      'tree_left'            => new sfWidgetFormInput(),
      'tree_right'           => new sfWidgetFormInput(),
      'tree_parent'          => new sfWidgetFormInput(),
      'tree_id'              => new sfWidgetFormInput(),
      'is_visible_in_menu'   => new sfWidgetFormInputCheckbox(),
      'current_layout'       => new sfWidgetFormInput(),
      'current_layout_type'  => new sfWidgetFormInput(),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorPropelChoice(array('model' => 'Node', 'column' => 'id', 'required' => false)),
      'is_public'            => new sfValidatorBoolean(),
      'node_class'           => new sfValidatorString(array('max_length' => 255)),
      'url_provider'         => new sfValidatorInteger(array('required' => false)),
      'open_target_provider' => new sfValidatorInteger(array('required' => false)),
      'perms_type'           => new sfValidatorInteger(array('required' => false)),
      'credentials'          => new sfValidatorString(array('required' => false)),
      'tree_left'            => new sfValidatorInteger(),
      'tree_right'           => new sfValidatorInteger(),
      'tree_parent'          => new sfValidatorInteger(array('required' => false)),
      'tree_id'              => new sfValidatorInteger(),
      'is_visible_in_menu'   => new sfValidatorBoolean(),
      'current_layout'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'current_layout_type'  => new sfValidatorInteger(),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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

  public function getI18nModelName()
  {
    return 'NodeI18n';
  }

  public function getI18nFormClass()
  {
    return 'NodeI18nForm';
  }

}
