<?php

/**
 * KataoInvoice form base class.
 *
 * @package    form
 * @subpackage katao_invoice
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoInvoiceForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'katao_member_id'    => new sfWidgetFormPropelSelect(array('model' => 'KataoMember', 'add_empty' => false)),
      'katao_period_id'    => new sfWidgetFormPropelSelect(array('model' => 'KataoPeriod', 'add_empty' => false)),
      'katao_node_id'      => new sfWidgetFormPropelSelect(array('model' => 'KataoNode', 'add_empty' => false)),
      'katao_cart_id'      => new sfWidgetFormPropelSelect(array('model' => 'KataoCart', 'add_empty' => true)),
      'status'             => new sfWidgetFormInput(),
      'member_first_name'  => new sfWidgetFormInput(),
      'member_last_name'   => new sfWidgetFormInput(),
      'member_email'       => new sfWidgetFormInput(),
      'member_address1'    => new sfWidgetFormInput(),
      'member_address2'    => new sfWidgetFormInput(),
      'member_zip'         => new sfWidgetFormInput(),
      'member_city'        => new sfWidgetFormInput(),
      'katao_name'         => new sfWidgetFormInput(),
      'katao_address'      => new sfWidgetFormTextarea(),
      'katao_siret_number' => new sfWidgetFormInput(),
      'katao_rcs_number'   => new sfWidgetFormInput(),
      'katao_capital'      => new sfWidgetFormInput(),
      'sol_amount'         => new sfWidgetFormInput(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorPropelChoice(array('model' => 'KataoInvoice', 'column' => 'id', 'required' => false)),
      'katao_member_id'    => new sfValidatorPropelChoice(array('model' => 'KataoMember', 'column' => 'id')),
      'katao_period_id'    => new sfValidatorPropelChoice(array('model' => 'KataoPeriod', 'column' => 'id')),
      'katao_node_id'      => new sfValidatorPropelChoice(array('model' => 'KataoNode', 'column' => 'id')),
      'katao_cart_id'      => new sfValidatorPropelChoice(array('model' => 'KataoCart', 'column' => 'id', 'required' => false)),
      'status'             => new sfValidatorInteger(),
      'member_first_name'  => new sfValidatorString(array('max_length' => 255)),
      'member_last_name'   => new sfValidatorString(array('max_length' => 255)),
      'member_email'       => new sfValidatorString(array('max_length' => 255)),
      'member_address1'    => new sfValidatorString(array('max_length' => 255)),
      'member_address2'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'member_zip'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'member_city'        => new sfValidatorString(array('max_length' => 255)),
      'katao_name'         => new sfValidatorString(array('max_length' => 255)),
      'katao_address'      => new sfValidatorString(array('required' => false)),
      'katao_siret_number' => new sfValidatorString(array('max_length' => 14)),
      'katao_rcs_number'   => new sfValidatorString(array('max_length' => 255)),
      'katao_capital'      => new sfValidatorInteger(),
      'sol_amount'         => new sfValidatorInteger(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
