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

Revision 48, 1.9 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  * Event form base class.
5  *
6  * @package    form
7  * @subpackage event
8  * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
9  */
10 class BaseEventForm extends BaseFormPropel
11 {
12   public function setup()
13   {
14     $this->setWidgets(array(
15       'id'           => new sfWidgetFormInputHidden(),
16       'type'         => new sfWidgetFormInput(),
17       'source_model' => new sfWidgetFormInput(),
18       'source_name'  => new sfWidgetFormInput(),
19       'source_slug'  => new sfWidgetFormInput(),
20       'target_model' => new sfWidgetFormInput(),
21       'target_name'  => new sfWidgetFormInput(),
22       'target_slug'  => new sfWidgetFormInput(),
23       'occured_at'   => new sfWidgetFormDateTime(),
24       'is_admin'     => new sfWidgetFormInputCheckbox(),
25     ));
26
27     $this->setValidators(array(
28       'id'           => new sfValidatorPropelChoice(array('model' => 'Event', 'column' => 'id', 'required' => false)),
29       'type'         => new sfValidatorString(array('max_length' => 255)),
30       'source_model' => new sfValidatorString(array('max_length' => 25)),
31       'source_name'  => new sfValidatorString(array('max_length' => 255)),
32       'source_slug'  => new sfValidatorString(array('max_length' => 255)),
33       'target_model' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
34       'target_name'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
35       'target_slug'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
36       'occured_at'   => new sfValidatorDateTime(),
37       'is_admin'     => new sfValidatorBoolean(array('required' => false)),
38     ));
39
40     $this->widgetSchema->setNameFormat('event[%s]');
41
42     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
43
44     parent::setup();
45   }
46
47   public function getModelName()
48   {
49     return 'Event';
50   }
51
52
53 }
54
Note: See TracBrowser for help on using the browser.