BaseClassTableForm.class.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * ClassTable 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 BaseClassTableForm extends BaseFormPropel
  11. {
  12. public function setup()
  13. {
  14. $this->setWidgets(array(
  15. 'id' => new sfWidgetFormInputHidden(),
  16. 'name' => new sfWidgetFormInput(),
  17. 'faculty' => new sfWidgetFormInput(),
  18. 'profession_id' => new sfWidgetFormPropelChoice(array('model' => 'ProfessionsTable', 'add_empty' => true)),
  19. ));
  20. $this->setValidators(array(
  21. 'id' => new sfValidatorPropelChoice(array('model' => 'ClassTable', 'column' => 'id', 'required' => false)),
  22. 'name' => new sfValidatorString(array('max_length' => 20)),
  23. 'faculty' => new sfValidatorString(array('max_length' => 4)),
  24. 'profession_id' => new sfValidatorPropelChoice(array('model' => 'ProfessionsTable', 'column' => 'id', 'required' => false)),
  25. ));
  26. $this->widgetSchema->setNameFormat('class_table[%s]');
  27. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  28. parent::setup();
  29. }
  30. public function getModelName()
  31. {
  32. return 'ClassTable';
  33. }
  34. }