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

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