<?php
namespace App\Form\Input; class Autocomplete_Data_CorporateBankAccount extends \Engine\Form\Input\Autocomplete_Data_GeneralAbstract { protected $minLength = 0; protected function getPageResultsBulk() :array { $corporatesOfficesBankAccountsListObj = new \App\EntityList\CorporateOfficeBankAccounts(); $corporatesOfficesBankAccountsListObj->applyUserRestriction(false); $corporatesOfficesBankAccountsListObj->setColumns(['corpOffBankAccounts.account', 'corpOffBankAccounts.currency', 'banks.bankName']); $corporatesOfficesBankAccountsListObj->setFilter('corpOffBankAccounts.account', 'LIKE', "{$this->searchString}%"); if ($this->filters['idCompany']) { $corporatesOfficesBankAccountsListObj->setFilter('corpOffices.idCorporate', 'LIKE', $this->filters['idCompany']); } $corporatesOfficesBankAccountsListObj->setOrderBy('corpOffBankAccounts.account', 'ASC'); $corporatesOfficesBankAccountsListObj->setLimit($this->offset, $this->resultsCountPage); return $this->executeSqlEntityList($corporatesOfficesBankAccountsListObj); } protected function getPageResultsFormatted(Array $pageResults) { $list = []; foreach ($pageResults as $row) { $extra = $row['bankName']; if ($row['currency']) { $extra.=" [".$row['currency']."]"; } $list[] = $this->getCleanItem($row['id'], $row['account'], $extra, ''); } return $list; } }