<?php

/**
 * Organization form base class.
 *
 * @method Organization 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 BaseOrganizationForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInputText(),
      'description' => new sfWidgetFormTextarea(),
      'policy'      => new sfWidgetFormTextarea(),
      'contactus'   => new sfWidgetFormTextarea(),
      'logo'        => new sfWidgetFormInputText(),
      'domain'      => new sfWidgetFormInputText(),
      'website'     => new sfWidgetFormInputText(),
      'type'        => new sfWidgetFormInputText(),
      'out_image'   => new sfWidgetFormInputText(),
      'lat'         => new sfWidgetFormInputText(),
      'lng'         => new sfWidgetFormInputText(),
      'is_active'   => new sfWidgetFormInputText(),
      'is_top'      => new sfWidgetFormInputText(),
    ));

    $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' => 252)),
      'description' => new sfValidatorString(),
      'policy'      => new sfValidatorString(),
      'contactus'   => new sfValidatorString(),
      'logo'        => new sfValidatorString(array('max_length' => 255)),
      'domain'      => new sfValidatorString(array('max_length' => 255)),
      'website'     => new sfValidatorString(array('max_length' => 255)),
      'type'        => new sfValidatorInteger(),
      'out_image'   => new sfValidatorString(array('max_length' => 255)),
      'lat'         => new sfValidatorNumber(),
      'lng'         => new sfValidatorNumber(),
      'is_active'   => new sfValidatorInteger(),
      'is_top'      => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('organization[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Organization';
  }

}
