<?php

/**
 * NodeNews form base class.
 *
 * @package    form
 * @subpackage node_news
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseNodeNewsForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'node_id'      => new sfWidgetFormPropelSelect(array('model' => 'Node', 'add_empty' => true)),
      'published_at' => new sfWidgetFormDateTime(),
      'introduction' => new sfWidgetFormTextarea(),
      'content'      => new sfWidgetFormTextarea(),
      'picture'      => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorPropelChoice(array('model' => 'NodeNews', 'column' => 'id', 'required' => false)),
      'node_id'      => new sfValidatorPropelChoice(array('model' => 'Node', 'column' => 'id', 'required' => false)),
      'published_at' => new sfValidatorDateTime(array('required' => false)),
      'introduction' => new sfValidatorString(array('required' => false)),
      'content'      => new sfValidatorString(array('required' => false)),
      'picture'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
