<?php

/**
 * KataoProduct form base class.
 *
 * @package    form
 * @subpackage katao_product
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                       => new sfWidgetFormInputHidden(),
      'reference'                => new sfWidgetFormInput(),
      'name'                     => new sfWidgetFormInput(),
      'url_identifier'           => new sfWidgetFormInput(),
      'description'              => new sfWidgetFormTextarea(),
      'katao_product_family_id'  => new sfWidgetFormPropelSelect(array('model' => 'KataoProductFamily', 'add_empty' => false)),
      'katao_supplier_id'        => new sfWidgetFormPropelSelect(array('model' => 'KataoSupplier', 'add_empty' => false)),
      'max_sol_amount'           => new sfWidgetFormInput(),
      'unit_price_euro'          => new sfWidgetFormInput(),
      'margin'                   => new sfWidgetFormInput(),
      'tva_rate'                 => new sfWidgetFormInput(),
      'min_order_number'         => new sfWidgetFormInput(),
      'picture'                  => new sfWidgetFormInput(),
      'delivery_delay'           => new sfWidgetFormInput(),
      'is_archived'              => new sfWidgetFormInput(),
      'accounting_code_purchase' => new sfWidgetFormInput(),
      'accounting_code_sell'     => new sfWidgetFormInput(),
      'created_at'               => new sfWidgetFormDateTime(),
      'updated_at'               => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                       => new sfValidatorPropelChoice(array('model' => 'KataoProduct', 'column' => 'id', 'required' => false)),
      'reference'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'name'                     => new sfValidatorString(array('max_length' => 255)),
      'url_identifier'           => new sfValidatorString(array('max_length' => 255)),
      'description'              => new sfValidatorString(array('required' => false)),
      'katao_product_family_id'  => new sfValidatorPropelChoice(array('model' => 'KataoProductFamily', 'column' => 'id')),
      'katao_supplier_id'        => new sfValidatorPropelChoice(array('model' => 'KataoSupplier', 'column' => 'id')),
      'max_sol_amount'           => new sfValidatorInteger(array('required' => false)),
      'unit_price_euro'          => new sfValidatorNumber(),
      'margin'                   => new sfValidatorNumber(array('required' => false)),
      'tva_rate'                 => new sfValidatorNumber(array('required' => false)),
      'min_order_number'         => new sfValidatorInteger(),
      'picture'                  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'delivery_delay'           => new sfValidatorInteger(array('required' => false)),
      'is_archived'              => new sfValidatorInteger(array('required' => false)),
      'accounting_code_purchase' => new sfValidatorString(array('max_length' => 12)),
      'accounting_code_sell'     => new sfValidatorString(array('max_length' => 12)),
      'created_at'               => new sfValidatorDateTime(array('required' => false)),
      'updated_at'               => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
