root/trunk/lib/form/base/BaseCompanyPersonForm.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  * CompanyPerson form base class.
5  *
6  * @package    form
7  * @subpackage company_person
8  * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
9  */
10 class BaseCompanyPersonForm extends BaseFormPropel
11 {
12   public function setup()
13   {
14     $this->setWidgets(array(
15       'id'          => new sfWidgetFormInputHidden(),
16       'user_id'     => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
17       'company_id'  => new sfWidgetFormPropelSelect(array('model' => 'Company', 'add_empty' => false)),
18       'role'        => new sfWidgetFormInput(),
19       'description' => new sfWidgetFormTextarea(),
20       'started_at'  => new sfWidgetFormDateTime(),
21       'ended_at'    => new sfWidgetFormDateTime(),
22       'created_at'  => new sfWidgetFormDateTime(),
23       'updated_at'  => new sfWidgetFormDateTime(),
24     ));
25
26     $this->setValidators(array(
27       'id'          => new sfValidatorPropelChoice(array('model' => 'CompanyPerson', 'column' => 'id', 'required' => false)),
28       'user_id'     => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
29       'company_id'  => new sfValidatorPropelChoice(array('model' => 'Company', 'column' => 'id')),
30       'role'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
31       'description' => new sfValidatorString(array('required' => false)),
32       'started_at'  => new sfValidatorDateTime(array('required' => false)),
33       'ended_at'    => new sfValidatorDateTime(array('required' => false)),
34       'created_at'  => new sfValidatorDateTime(array('required' => false)),
35       'updated_at'  => new sfValidatorDateTime(array('required' => false)),
36     ));
37
38     $this->widgetSchema->setNameFormat('company_person[%s]');
39
40     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
41
42     parent::setup();
43   }
44
45   public function getModelName()
46   {
47     return 'CompanyPerson';
48   }
49
50
51 }
52
Note: See TracBrowser for help on using the browser.