<?php

/**
 * KataoConfig form base class.
 *
 * @package    form
 * @subpackage katao_config
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoConfigForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                                        => new sfWidgetFormInputHidden(),
      'katao_member_id'                           => new sfWidgetFormPropelSelect(array('model' => 'KataoMember', 'add_empty' => true)),
      'name'                                      => new sfWidgetFormInput(),
      'address'                                   => new sfWidgetFormTextarea(),
      'phone'                                     => new sfWidgetFormInput(),
      'email'                                     => new sfWidgetFormInput(),
      'siret_number'                              => new sfWidgetFormInput(),
      'tva_number'                                => new sfWidgetFormInput(),
      'rcs_number'                                => new sfWidgetFormInput(),
      'capital'                                   => new sfWidgetFormInput(),
      'initial_transactions_count'                => new sfWidgetFormInput(),
      'initial_transactions_sum'                  => new sfWidgetFormInput(),
      'default_product_picture'                   => new sfWidgetFormInput(),
      'default_product_margin'                    => new sfWidgetFormInput(),
      'default_product_sol_percent'               => new sfWidgetFormInput(),
      'mailing_list_email'                        => new sfWidgetFormInput(),
      'cart_validation_days_number'               => new sfWidgetFormInput(),
      'accounting_code_prefix_purchase'           => new sfWidgetFormInput(),
      'accounting_code_prefix_sell'               => new sfWidgetFormInput(),
      'accounting_code_bank'                      => new sfWidgetFormInput(),
      'accounting_code_bank_sol'                  => new sfWidgetFormInput(),
      'accounting_code_credit'                    => new sfWidgetFormInput(),
      'accounting_code_error_adjustment_positive' => new sfWidgetFormInput(),
      'accounting_code_error_adjustment_negative' => new sfWidgetFormInput(),
      'accounting_code_sol_discount'              => new sfWidgetFormInput(),
      'accounting_code_fees_shipping'             => new sfWidgetFormInput(),
      'accounting_code_fees_billing'              => new sfWidgetFormInput(),
      'accounting_code_discount'                  => new sfWidgetFormInput(),
      'member_fee'                                => new sfWidgetFormInput(),
      'additional_currency_name'                  => new sfWidgetFormInput(),
      'debug_email'                               => new sfWidgetFormInput(),
      'bank_name'                                 => new sfWidgetFormInput(),
      'bank_account'                              => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                                        => new sfValidatorPropelChoice(array('model' => 'KataoConfig', 'column' => 'id', 'required' => false)),
      'katao_member_id'                           => new sfValidatorPropelChoice(array('model' => 'KataoMember', 'column' => 'id', 'required' => false)),
      'name'                                      => new sfValidatorString(array('max_length' => 255)),
      'address'                                   => new sfValidatorString(array('required' => false)),
      'phone'                                     => new sfValidatorString(array('max_length' => 255)),
      'email'                                     => new sfValidatorString(array('max_length' => 255)),
      'siret_number'                              => new sfValidatorString(array('max_length' => 14)),
      'tva_number'                                => new sfValidatorString(array('max_length' => 13)),
      'rcs_number'                                => new sfValidatorString(array('max_length' => 255)),
      'capital'                                   => new sfValidatorInteger(),
      'initial_transactions_count'                => new sfValidatorInteger(array('required' => false)),
      'initial_transactions_sum'                  => new sfValidatorNumber(array('required' => false)),
      'default_product_picture'                   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'default_product_margin'                    => new sfValidatorInteger(array('required' => false)),
      'default_product_sol_percent'               => new sfValidatorInteger(array('required' => false)),
      'mailing_list_email'                        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'cart_validation_days_number'               => new sfValidatorInteger(),
      'accounting_code_prefix_purchase'           => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_prefix_sell'               => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_bank'                      => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_bank_sol'                  => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_credit'                    => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_error_adjustment_positive' => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_error_adjustment_negative' => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_sol_discount'              => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_fees_shipping'             => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_fees_billing'              => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_discount'                  => new sfValidatorString(array('max_length' => 12)),
      'member_fee'                                => new sfValidatorNumber(array('required' => false)),
      'additional_currency_name'                  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'debug_email'                               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'bank_name'                                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'bank_account'                              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
