<?php
 namespace App\Form\Input; class Autocomplete_SupplierBankAccount extends Autocomplete_GeneralAbstract { public function __construct($label=null, $name=null, $value=null) { parent::__construct($label, $name, $value); } public function getUrl() { return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'supplierBankAccount'])); } public function determineDisplayValue($displayId) :string { global $DBTSuppliersBankAccounts; $sql = "SELECT account FROM `$DBTSuppliersBankAccounts` WHERE `id`=?"; $sqlEx = \DB::getInstance()->Execute($sql, [$displayId]); $results = []; foreach ($sqlEx as $bankAccount) { $results[] = $bankAccount['account']; } if (count($results)==1) { return $results[0]; } else { return ''; } } } 