BaseKataoProductForm.class.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. 'accounting_code_purchase' => new sfWidgetFormInput(),
  30. 'accounting_code_sell' => new sfWidgetFormInput(),
  31. 'created_at' => new sfWidgetFormDateTime(),
  32. 'updated_at' => new sfWidgetFormDateTime(),
  33. ));
  34. $this->setValidators(array(
  35. 'id' => new sfValidatorPropelChoice(array('model' => 'KataoProduct', 'column' => 'id', 'required' => false)),
  36. 'reference' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  37. 'name' => new sfValidatorString(array('max_length' => 255)),
  38. 'url_identifier' => new sfValidatorString(array('max_length' => 255)),
  39. 'description' => new sfValidatorString(array('required' => false)),
  40. 'katao_product_family_id' => new sfValidatorPropelChoice(array('model' => 'KataoProductFamily', 'column' => 'id')),
  41. 'katao_supplier_id' => new sfValidatorPropelChoice(array('model' => 'KataoSupplier', 'column' => 'id')),
  42. 'max_sol_amount' => new sfValidatorInteger(array('required' => false)),
  43. 'unit_price_euro' => new sfValidatorNumber(),
  44. 'margin' => new sfValidatorNumber(array('required' => false)),
  45. 'tva_rate' => new sfValidatorNumber(array('required' => false)),
  46. 'min_order_number' => new sfValidatorInteger(),
  47. 'picture' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  48. 'delivery_delay' => new sfValidatorInteger(array('required' => false)),
  49. 'is_archived' => new sfValidatorInteger(array('required' => false)),
  50. 'accounting_code_purchase' => new sfValidatorString(array('max_length' => 12)),
  51. 'accounting_code_sell' => new sfValidatorString(array('max_length' => 12)),
  52. 'created_at' => new sfValidatorDateTime(array('required' => false)),
  53. 'updated_at' => new sfValidatorDateTime(array('required' => false)),
  54. ));
  55. $this->widgetSchema->setNameFormat('katao_product[%s]');
  56. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  57. parent::setup();
  58. }
  59. public function getModelName()
  60. {
  61. return 'KataoProduct';
  62. }
  63. }