BaseNodeHomeForm.class.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * NodeHome form base class.
  4. *
  5. * @package form
  6. * @subpackage node_home
  7. * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
  8. */
  9. class BaseNodeHomeForm extends BaseFormPropel
  10. {
  11. public function setup()
  12. {
  13. $this->setWidgets(array(
  14. 'id' => new sfWidgetFormInputHidden(),
  15. 'node_id' => new sfWidgetFormPropelSelect(array('model' => 'Node', 'add_empty' => true)),
  16. 'edito_title' => new sfWidgetFormInput(),
  17. 'edito_content' => new sfWidgetFormTextarea(),
  18. ));
  19. $this->setValidators(array(
  20. 'id' => new sfValidatorPropelChoice(array('model' => 'NodeHome', 'column' => 'id', 'required' => false)),
  21. 'node_id' => new sfValidatorPropelChoice(array('model' => 'Node', 'column' => 'id', 'required' => false)),
  22. 'edito_title' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  23. 'edito_content' => new sfValidatorString(array('required' => false)),
  24. ));
  25. $this->widgetSchema->setNameFormat('node_home[%s]');
  26. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  27. parent::setup();
  28. }
  29. public function getModelName()
  30. {
  31. return 'NodeHome';
  32. }
  33. }