Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct()
- {
- $criteria = new Criteria();
- $criteria->setDistinct();
- $criteria->clearSelectColumns()->addSelectColumn(VigiCultCommunePeer::DEPARTEMENT);
- $criteria->addAscendingOrderByColumn(VigiCultCommunePeer::DEPARTEMENT);
- $criteria->addGroupByColumn("DEPARTEMENT");
- $rs = VigiCultCommunePeer::doSelectRS($criteria);
- $this->choices = array();
- while($rs->next()) {
- $this->choices[] = $rs->get(1);
- }
- parent::__construct();
- }
- public function configure()
- {
- // partie liste des groupes
- $groupe_criteria = new Criteria();
- $groupe_criteria->add(sfGuardGroupPeer::REGION_ID, NULL ,Criteria::ISNOTNULL);
- $this->widgetSchema['groupe_id'] = new sfWidgetFormPropelSelect(array('model' => 'sfGuardGroup', 'criteria'=>$groupe_criteria, 'order_by' => array('Name','asc'), 'add_empty'=>false));
- // partie liste des departements
- $this->widgetSchema['departement'] = new sfWidgetFormSchema();
- $this->validatorSchema['departement'] = new sfValidatorSchema();
- foreach ($this->choices as $value)
- {
- $this->widgetSchema['departement'][$value] = new sfWidgetFormInputCheckbox();
- $this->validatorSchema['departement'][$value] = new sfValidatorPass();
- }
- $this->widgetSchema['departement'] = new sfWidgetFormSchemaDecorator($this->widgetSchema['departement'],$this->widgetSchema['departement']->getFormF
Add Comment
Please, Sign In to add comment