<?php

/**
 * Company form base class.
 *
 * @method Company 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 BaseLegalForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'name'       => new sfWidgetFormInputText(),
      'category_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Category'), 'add_empty' => true)),
      'body'            => new sfWidgetFormTextarea(),
	  'requirement'            => new sfWidgetFormTextarea(),
	  'file_name'            => new sfWidgetFormInputText(),
      'is_active'  => new sfWidgetFormInputText(),
      'published_at'      => new sfWidgetFormDateTime(),
	  'number'       => new sfWidgetFormInputText(),
      'adopt_date'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'name'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'category_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Category'), 'required' => false)),
      'body'       => new sfValidatorString(array('required' => false)),
	  'requirement'       => new sfValidatorString(array('required' => false)),
	  'file_name'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'is_active'       => new sfValidatorInteger(array('required' => false)),
      'published_at'   => new sfValidatorDateTime(array('required' => false)),
	  'number'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'adopt_date'   => new sfValidatorDateTime(array('required' => false)),
    ));
	
	
    $this->widgetSchema->setNameFormat('legal[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Legal';
  }

}
