<?php

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

    $this->setValidators(array(
      'id'                     => new sfValidatorPropelChoice(array('model' => 'KataoCartProduct', 'column' => 'id', 'required' => false)),
      'katao_cart_id'          => new sfValidatorPropelChoice(array('model' => 'KataoCart', 'column' => 'id')),
      'katao_product_id'       => new sfValidatorPropelChoice(array('model' => 'KataoProduct', '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_adjusted'      => new sfValidatorInteger(array('required' => false)),
      'has_been_adjusted'      => new sfValidatorInteger(array('required' => false)),
      'quantity_delivered'     => new sfValidatorInteger(array('required' => false)),
      'katao_order_product_id' => new sfValidatorPropelChoice(array('model' => 'KataoOrderProduct', 'column' => 'id', 'required' => false)),
      'created_at'             => new sfValidatorDateTime(array('required' => false)),
      'updated_at'             => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
