BaseKataoProductForm.class.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * KataoProduct form base class.
  4. *
  5. * @package form
  6. * @subpackage katao_product
  7. * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
  8. */
  9. class BaseKataoProductForm extends BaseFormPropel
  10. {
  11. public function setup()
  12. {
  13. $this->setWidgets(array(
  14. 'id' => new sfWidgetFormInputHidden(),
  15. 'reference' => new sfWidgetFormInput(),
  16. 'name' => new sfWidgetFormInput(),
  17. 'url_identifier' => new sfWidgetFormInput(),
  18. 'description' => new sfWidgetFormTextarea(),
  19. 'katao_product_family_id' => new sfWidgetFormPropelSelect(array('model' => 'KataoProductFamily', 'add_empty' => false)),
  20. 'katao_supplier_id' => new sfWidgetFormPropelSelect(array('model' => 'KataoSupplier', 'add_empty' => false)),
  21. 'max_sol_amount' => new sfWidgetFormInput(),
  22. 'unit_price_euro' => new sfWidgetFormInput(),
  23. 'margin' => new sfWidgetFormInput(),
  24. 'tva_rate' => new sfWidgetFormInput(),
  25. 'min_order_number' => new sfWidgetFormInput(),
  26. 'picture' => new sfWidgetFormInput(),
  27. 'delivery_delay' => new sfWidgetFormInput(),
  28. 'is_archived' => new sfWidgetFormInput(),
  29. 'authorize_decimal' => new sfWidgetFormInput(),
  30. 'accounting_code_purchase' => new sfWidgetFormInput(),
  31. 'accounting_code_sell' => new sfWidgetFormInput(),
  32. 'created_at' => new sfWidgetFormDateTime(),
  33. 'updated_at' => new sfWidgetFormDateTime(),
  34. ));
  35. $this->setValidators(array(
  36. 'id' => new sfValidatorPropelChoice(array('model' => 'KataoProduct', 'column' => 'id', 'required' => false)),
  37. 'reference' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  38. 'name' => new sfValidatorString(array('max_length' => 255)),
  39. 'url_identifier' => new sfValidatorString(array('max_length' => 255)),
  40. 'description' => new sfValidatorString(array('required' => false)),
  41. 'katao_product_family_id' => new sfValidatorPropelChoice(array('model' => 'KataoProductFamily', 'column' => 'id')),
  42. 'katao_supplier_id' => new sfValidatorPropelChoice(array('model' => 'KataoSupplier', 'column' => 'id')),
  43. 'max_sol_amount' => new sfValidatorInteger(array('required' => false)),
  44. 'unit_price_euro' => new sfValidatorNumber(),
  45. 'margin' => new sfValidatorNumber(array('required' => false)),
  46. 'tva_rate' => new sfValidatorNumber(array('required' => false)),
  47. 'min_order_number' => new sfValidatorInteger(),
  48. 'picture' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  49. 'delivery_delay' => new sfValidatorInteger(array('required' => false)),
  50. 'is_archived' => new sfValidatorInteger(array('required' => false)),
  51. 'authorize_decimal' => new sfValidatorInteger(array('required' => false)),
  52. 'accounting_code_purchase' => new sfValidatorString(array('max_length' => 12)),
  53. 'accounting_code_sell' => new sfValidatorString(array('max_length' => 12)),
  54. 'created_at' => new sfValidatorDateTime(array('required' => false)),
  55. 'updated_at' => new sfValidatorDateTime(array('required' => false)),
  56. ));
  57. $this->widgetSchema->setNameFormat('katao_product[%s]');
  58. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  59. parent::setup();
  60. }
  61. public function getModelName()
  62. {
  63. return 'KataoProduct';
  64. }
  65. }