<?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 BaseCompanyForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'name'       => new sfWidgetFormInputText(),
      'about'     => new sfWidgetFormTextarea(),
      'wrkr'            => new sfWidgetFormTextarea(),
      'branch'            => new sfWidgetFormTextarea(),
      'type' => new sfWidgetFormInputText(),
      'sub_type' => new sfWidgetFormInputText(),
      'issued'  => new sfWidgetFormDate(),
      'introduction'  => new sfWidgetFormTextarea(),
	  'address'       => new sfWidgetFormTextarea(),
      'is_active'  => new sfWidgetFormInputText(),
      'created_at'      => 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)),
      'about'     => new sfValidatorString(array('required' => false)),
      'wrkr'       => new sfValidatorString(array('required' => false)),
      'branch'       => new sfValidatorString(array('required' => false)),
      'type'         => new sfValidatorInteger(),
      'sub_type'     => new sfValidatorInteger(),
      'issued'       => new sfValidatorDate(array('required' => false)),
      'introduction' => new sfValidatorString(array('required' => false)),
	  'address'           => new sfValidatorString(array('required' => false)),
      'is_active'    => new sfValidatorInteger(),
      'created_at'   => new sfValidatorDateTime(array('required' => false)),
    ));
	
	
    $this->widgetSchema->setNameFormat('company[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Company';
  }

}
