root/trunk/lib/form/ApplicationCompanyForm.class.php

Revision 75, 0.8 kB (checked in by nperriault, 5 months ago)

[1.1]:

  • Companies and people modules migrated, with according form classes and templates, and functional test suite
  • Enhanced SymfoniansTestBrowser?
Line 
1 <?php
2 /**
3  * ApplicationCompany form.
4  *
5  * @package    form
6  * @subpackage application_company
7  */
8 class ApplicationCompanyForm extends BaseApplicationCompanyForm
9 {
10   /**
11    * Form configuration
12    *
13    */
14   public function configure()
15   {
16     if (!is_array($this->getOption('companies')) || array() === $this->getOption('companies'))
17     {
18       $this->setOption('companies', array());
19     }
20
21     unset($this['id']);
22
23     $this->widgetSchema['company_id'] = new sfWidgetFormSelect(array('choices' => $this->getOption('companies')));
24     $this->validatorSchema['company_id'] = new sfValidatorChoice(array('choices' => array_keys($this->getOption('companies'))));
25
26     $this->mergeForm(new BaseConnectionForm());
27
28     $this->widgetSchema->setNameFormat('connection[%s]');
29   }
30 }
31
Note: See TracBrowser for help on using the browser.