<?php
 namespace App\Form\Input; class Autocomplete_MiceTypeAndProject extends Autocomplete_GeneralAbstract { protected $class = "autocomplete"; public function getUrl() { return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'MiceTypeAndProject'])); } public function getValue() { $v = parent::getValue(); if ($v==='|') { $v = ''; } return $v; } public function determineDisplayValue($displayId) :string { if ($displayId) { list($idProjectType, $idProject) = explode('|', $displayId); if ($idProject) { return (string)\Entity\MiceProject::select($idProject)->name; } elseif ($idProjectType) { return (string)\Entity\MiceProjectType::select($idProjectType)->name; } else { return ''; } } return ''; } } 