BaseNodeNewsForm.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * NodeNews form base class.
  4. *
  5. * @package form
  6. * @subpackage node_news
  7. * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
  8. */
  9. class BaseNodeNewsForm 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. 'published_at' => new sfWidgetFormDateTime(),
  17. 'introduction' => new sfWidgetFormTextarea(),
  18. 'content' => new sfWidgetFormTextarea(),
  19. 'picture' => new sfWidgetFormInput(),
  20. ));
  21. $this->setValidators(array(
  22. 'id' => new sfValidatorPropelChoice(array('model' => 'NodeNews', 'column' => 'id', 'required' => false)),
  23. 'node_id' => new sfValidatorPropelChoice(array('model' => 'Node', 'column' => 'id', 'required' => false)),
  24. 'published_at' => new sfValidatorDateTime(array('required' => false)),
  25. 'introduction' => new sfValidatorString(array('required' => false)),
  26. 'content' => new sfValidatorString(array('required' => false)),
  27. 'picture' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
  28. ));
  29. $this->widgetSchema->setNameFormat('node_news[%s]');
  30. $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  31. parent::setup();
  32. }
  33. public function getModelName()
  34. {
  35. return 'NodeNews';
  36. }
  37. }