<?php

/**
 * KataoSupplierInvoiceProduct form base class.
 *
 * @package    form
 * @subpackage katao_supplier_invoice_product
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoSupplierInvoiceProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                        => new sfWidgetFormInputHidden(),
      'katao_supplier_invoice_id' => new sfWidgetFormPropelSelect(array('model' => 'KataoSupplierInvoice', 'add_empty' => true)),
      'katao_product_id'          => new sfWidgetFormPropelSelect(array('model' => 'KataoProduct', 'add_empty' => true)),
      'product_reference'         => new sfWidgetFormInput(),
      'product_name'              => new sfWidgetFormInput(),
      'product_price_euro'        => new sfWidgetFormInput(),
      'product_margin'            => new sfWidgetFormInput(),
      'product_tva_rate'          => new sfWidgetFormInput(),
      'quantity'                  => new sfWidgetFormInput(),
      'product_price_total'       => new sfWidgetFormInput(),
      'created_at'                => new sfWidgetFormDateTime(),
      'updated_at'                => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                        => new sfValidatorPropelChoice(array('model' => 'KataoSupplierInvoiceProduct', 'column' => 'id', 'required' => false)),
      'katao_supplier_invoice_id' => new sfValidatorPropelChoice(array('model' => 'KataoSupplierInvoice', 'column' => 'id', 'required' => false)),
      'katao_product_id'          => new sfValidatorPropelChoice(array('model' => 'KataoProduct', 'column' => 'id', 'required' => false)),
      'product_reference'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'product_name'              => new sfValidatorString(array('max_length' => 255)),
      'product_price_euro'        => new sfValidatorNumber(),
      'product_margin'            => new sfValidatorNumber(array('required' => false)),
      'product_tva_rate'          => new sfValidatorNumber(array('required' => false)),
      'quantity'                  => new sfValidatorInteger(),
      'product_price_total'       => new sfValidatorNumber(array('required' => false)),
      'created_at'                => new sfValidatorDateTime(array('required' => false)),
      'updated_at'                => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
