<?php
namespace App\Form\Input; class Select_OrdersExternalSystem extends \Engine\Form\Input\Select { protected $manualValue = null; protected function determinePossibleValues() { $sysListObj = new \App\EntityList\ImportedOrdersSystems(); $sysListObj->setColumns(['name']); $sysListObj->setFilter('extResSys.active', '=', 1); $sysListObj->setOrderBy('extResSys.name', 'ASC'); $assocSystems = []; if ($this->manualValue) { $assocSystems[$this->manualValue['value']] = $this->manualValue['title']; } foreach($sysListObj->exportRecords() as $rec) { $assocSystems[$rec['id']] = $rec['name']; } return $assocSystems; } public function setManualValue($value, $title) { $this->manualValue = ['value'=>$value, 'title'=>$title]; } } 