root/trunk/lib/form/base/BaseRecommendationForm.class.php

Revision 48, 1.6 kB (checked in by nperriault, 8 months ago)

Upgraded scripts to use symfony 1.1, everything is broken, use with caution.

Line 
1 <?php
2
3 /**
4  * Recommendation form base class.
5  *
6  * @package    form
7  * @subpackage recommendation
8  * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
9  */
10 class BaseRecommendationForm extends BaseFormPropel
11 {
12   public function setup()
13   {
14     $this->setWidgets(array(
15       'id'             => new sfWidgetFormInputHidden(),
16       'recommender_id' => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
17       'recommended_id' => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
18       'content'        => new sfWidgetFormTextarea(),
19       'created_at'     => new sfWidgetFormDateTime(),
20       'updated_at'     => new sfWidgetFormDateTime(),
21     ));
22
23     $this->setValidators(array(
24       'id'             => new sfValidatorPropelChoice(array('model' => 'Recommendation', 'column' => 'id', 'required' => false)),
25       'recommender_id' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
26       'recommended_id' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
27       'content'        => new sfValidatorString(array('required' => false)),
28       'created_at'     => new sfValidatorDateTime(array('required' => false)),
29       'updated_at'     => new sfValidatorDateTime(array('required' => false)),
30     ));
31
32     $this->widgetSchema->setNameFormat('recommendation[%s]');
33
34     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
35
36     parent::setup();
37   }
38
39   public function getModelName()
40   {
41     return 'Recommendation';
42   }
43
44
45 }
46
Note: See TracBrowser for help on using the browser.