<?php
 namespace App\Form\Input; class ServicesAssociations extends \Engine\Form\Input\GeneralAssociations { public function __construct($label=null, $name=null, $value=null, $possibleValues=null) { parent::__construct($label, $name, $value); $servicesListAssoc = []; foreach(\App\Config\Services_Basic::getInstance()->getListGrouped() as $c1=>$serviceDet1) { if ($serviceDet1['type']=='service') { $servicesListAssoc[$c1] = $serviceDet1['name']; } else { foreach($serviceDet1['list'] as $c2=>$serviceDet2) { $servicesListAssoc[$c2] = $serviceDet2['name']; } } } $this->setAssociationsList($servicesListAssoc); } } 