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

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