<?php
 namespace App\Form\Input; class Autocomplete_CorporateOffice extends Autocomplete_GeneralAbstract { protected $class = "autocompleteCorporate"; public function __construct($label=null, $name=null, $value=null) { parent::__construct($label, $name, $value); $this->setStyle('minimumTextLength', 3); } public function getUrl() { return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'CorporateOffice'])); } public function determineDisplayValue($displayId) :string { if ($displayId) { list($idCorp, $idCorpOff) = explode('|', $displayId); return \Entity\Corporate::select($idCorp)->alias.' - '.\Entity\CorporateOffice::select($idCorpOff)->name; } return ''; } } 