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

Revision 48, 2.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  * Application form base class.
5  *
6  * @package    form
7  * @subpackage application
8  * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
9  */
10 class BaseApplicationForm extends BaseFormPropel
11 {
12   public function setup()
13   {
14     $this->setWidgets(array(
15       'id'              => new sfWidgetFormInputHidden(),
16       'submitter_id'    => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
17       'name'            => new sfWidgetFormInput(),
18       'slug'            => new sfWidgetFormInput(),
19       'description'     => new sfWidgetFormTextarea(),
20       'homepage'        => new sfWidgetFormInput(),
21       'feed_url'        => new sfWidgetFormInput(),
22       'screenshot_path' => new sfWidgetFormInput(),
23       'is_opensource'   => new sfWidgetFormInputCheckbox(),
24       'licence'         => new sfWidgetFormInput(),
25       'country'         => new sfWidgetFormInput(),
26       'is_featured'     => new sfWidgetFormInputCheckbox(),
27       'started_at'      => new sfWidgetFormDateTime(),
28       'released_at'     => new sfWidgetFormDateTime(),
29       'created_at'      => new sfWidgetFormDateTime(),
30       'updated_at'      => new sfWidgetFormDateTime(),
31     ));
32
33     $this->setValidators(array(
34       'id'              => new sfValidatorPropelChoice(array('model' => 'Application', 'column' => 'id', 'required' => false)),
35       'submitter_id'    => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
36       'name'            => new sfValidatorString(array('max_length' => 255)),
37       'slug'            => new sfValidatorString(array('max_length' => 255)),
38       'description'     => new sfValidatorString(array('required' => false)),
39       'homepage'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
40       'feed_url'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
41       'screenshot_path' => new sfValidatorString(array('max_length' => 150, 'required' => false)),
42       'is_opensource'   => new sfValidatorBoolean(array('required' => false)),
43       'licence'         => new sfValidatorString(array('max_length' => 30, 'required' => false)),
44       'country'         => new sfValidatorString(array('max_length' => 2, 'required' => false)),
45       'is_featured'     => new sfValidatorBoolean(array('required' => false)),
46       'started_at'      => new sfValidatorDateTime(array('required' => false)),
47       'released_at'     => new sfValidatorDateTime(array('required' => false)),
48       'created_at'      => new sfValidatorDateTime(array('required' => false)),
49       'updated_at'      => new sfValidatorDateTime(array('required' => false)),
50     ));
51
52     $this->widgetSchema->setNameFormat('application[%s]');
53
54     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
55
56     parent::setup();
57   }
58
59   public function getModelName()
60   {
61     return 'Application';
62   }
63
64
65 }
66
Note: See TracBrowser for help on using the browser.