BaseUploadTableForm.class.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * UploadTable form base class.
  4. *
  5. * @package usic
  6. * @subpackage form
  7. * @author Your name here
  8. * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
  9. */
  10. class BaseUploadTableForm extends BaseFormPropel
  11. {
  12. public function setup()
  13. {
  14. $this->setWidgets(array(
  15. 'id' => new sfWidgetFormInputHidden(),
  16. 'user' => new sfWidgetFormInput(),
  17. 'daytime' => new sfWidgetFormDateTime(),
  18. 'url' => new sfWidgetFormTextarea(),
  19. 'filename' => new sfWidgetFormTextarea(),
  20. 'filesize' => new sfWidgetFormInput(),
  21. 'state' => new sfWidgetFormInput(),
  22. 'description' => new sfWidgetFormTextarea(),
  23. 'category_id' => new sfWidgetFormPropelChoice(array('model' => 'CategoryTable', 'add_empty' => false)),
  24. ));
  25. $this->setValidators(array(
  26. 'id' => new sfValidatorPropelChoice(array('model' => 'UploadTable', 'column' => 'id', 'required' => false)),
  27. 'user' => new sfValidatorString(array('max_length' => 25)),
  28. 'daytime' => new sfValidatorDateTime(),
  29. 'url' => new sfValidatorString(),
  30. 'filename' => new sfValidatorString(),
  31. 'filesize' => new sfValidatorInteger(),
  32. 'state' => new sfValidatorString(),
  33. 'description' => new sfValidatorString(array('required' => false)),
  34. 'category_id' => new sfValidatorPropelChoice(array('model' => 'CategoryTable', 'column' => 'id')),
  35. ));
  36. $this->widgetSchema->setNameFormat('upload_table[%s]');
  37. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  38. parent::setup();
  39. }
  40. public function getModelName()
  41. {
  42. return 'UploadTable';
  43. }
  44. }