<?php
 namespace App\Form\Input; class Autocomplete_BankAndOffice extends Autocomplete_GeneralAbstract { protected $class = "autocompleteBankAndOffice"; public function getUrl() { return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'BankAndOffice'])); } public function getValue() { $v = parent::getValue(); if ($v==='|') { $v = ''; } return $v; } public function determineDisplayValue($displayId) :string { if ($displayId) { $bankDet = explode('|', $displayId); $displayValue = ''; if ($bankDet[0]) $displayValue = \Entity\Bank::select($bankDet[0])->name; if ($bankDet[1]) $displayValue.=' '.\Entity\BankOffice::select($bankDet[1])->name; return $displayValue; } return ''; } } 