Rev 16785 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Form\Planning;use Laminas\Form\Form;use Laminas\Db\Adapter\AdapterInterface;use LeadersLinked\Mapper\PlanningPeriodMapper;class PlanningObjectiveHeaderForm extends Form{/**** @param AdapterInterface $dbAdapter* @param int $company_id*/public function __construct($dbAdapter, $company_id){parent::__construct();$this->setInputFilter(new PlanningObjectiveHeaderFilter());$this->add(['name' => 'period_id','type' => \Laminas\Form\Element\Select::class,'attributes' => ['id' => 'period_id',],'options' => ['value_options' => $this->plannigPeriod($dbAdapter, $company_id)]]);}/**** @param AdapterInterface $dbAdapter* @param int $company_id* return array*/private function plannigPeriod($dbAdapter, $company_id){$items = [];$planningPeriodMapper = PlanningPeriodMapper::getInstance($dbAdapter);$records = $planningPeriodMapper->fetchAllActiveByCompany($company_id);foreach($records as $record){$items[ $record->uuid ] = $record->title;}return $items;}}