<?php

namespace App\Form\Input;

/**
 * Bank autocomplete field
 *
 */
class Autocomplete_Bank extends Autocomplete_GeneralAbstract
{

	protected $class = "autocompleteBank";

	/**
	 * (non-PHPdoc)
	 * @see \Engine\Form\Input\Autocomplete::getUrl()
	 */
	public function getUrl()
	{
		return ($this->url?:\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/RemoteData/AutocompleteFieldData', '', ['class'=>'Bank']));
	}

	/**
	 * (non-PHPdoc)
	 * @see \Engine\Form\Input\Autocomplete::determineDisplayValue()
	 */
	public function determineDisplayValue($displayId) :string
	{
		return (string)\Entity\Bank::select($displayId)->name;
	}

}
