<?php

/**
 * KataoInvoiceProduct form base class.
 *
 * @package    form
 * @subpackage katao_invoice_product
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoInvoiceProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'katao_invoice_id'       => new sfWidgetFormPropelSelect(array('model' => 'KataoInvoice', 'add_empty' => false)),
      'katao_product_id'       => new sfWidgetFormPropelSelect(array('model' => 'KataoProduct', 'add_empty' => false)),
      'katao_cart_product_id'  => new sfWidgetFormPropelSelect(array('model' => 'KataoCartProduct', 'add_empty' => false)),
      'katao_order_product_id' => new sfWidgetFormPropelSelect(array('model' => 'KataoOrderProduct', 'add_empty' => false)),
      '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(),
      'quantity_delivered'     => new sfWidgetFormInput(),
      'sol_amount'             => new sfWidgetFormInput(),
      'created_at'             => new sfWidgetFormDateTime(),
      'updated_at'             => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorPropelChoice(array('model' => 'KataoInvoiceProduct', 'column' => 'id', 'required' => false)),
      'katao_invoice_id'       => new sfValidatorPropelChoice(array('model' => 'KataoInvoice', 'column' => 'id')),
      'katao_product_id'       => new sfValidatorPropelChoice(array('model' => 'KataoProduct', 'column' => 'id')),
      'katao_cart_product_id'  => new sfValidatorPropelChoice(array('model' => 'KataoCartProduct', 'column' => 'id')),
      'katao_order_product_id' => new sfValidatorPropelChoice(array('model' => 'KataoOrderProduct', 'column' => 'id')),
      '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(),
      'quantity_delivered'     => new sfValidatorInteger(array('required' => false)),
      '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_product[%s]');

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

    parent::setup();
  }

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


}
