<?php
 namespace App\Form\Input; class Autocomplete_OfficeAndIataCode extends Autocomplete_GeneralAbstract { protected $class = "autocomplete"; public function getUrl() { return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'OfficeAndIataCode'])); } public function determineDisplayValue($displayId) :string { if ($displayId) { list($id, $iataCode) = explode(":", $displayId); return sprintf("%s(%s)", \Entity\Office::select($id)->name, $iataCode); } return ''; } } 