<?php

/**
 * KataoOrderProduct form base class.
 *
 * @package    form
 * @subpackage katao_order_product
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseKataoOrderProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'katao_order_id'     => new sfWidgetFormPropelSelect(array('model' => 'KataoOrder', '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(),
      'quantity_received'  => new sfWidgetFormInput(),
      'quantity_delivered' => new sfWidgetFormInput(),
      'has_been_received'  => new sfWidgetFormInput(),
      'has_been_delivered' => new sfWidgetFormInput(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorPropelChoice(array('model' => 'KataoOrderProduct', 'column' => 'id', 'required' => false)),
      'katao_order_id'     => new sfValidatorPropelChoice(array('model' => 'KataoOrder', '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(),
      'quantity_received'  => new sfValidatorInteger(array('required' => false)),
      'quantity_delivered' => new sfValidatorInteger(array('required' => false)),
      'has_been_received'  => new sfValidatorInteger(array('required' => false)),
      'has_been_delivered' => new sfValidatorInteger(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

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

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

    parent::setup();
  }

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


}
