<?php
namespace App\Form\Input; class Autocomplete_Data_Spotlight extends \Engine\Form\Input\Autocomplete_Data_GeneralAbstract { protected function getPageResultsBulk() :array { $spotlightSearch = new \App\Spotlight\Search($this->searchString); $spotlightSearch->addSource(new \App\Spotlight\Source\Menu()); $spotlightSearch->addSource(new \App\Spotlight\Source\MathOperations()); $spotlightSearch->addSource(new \App\Spotlight\Source\CurrencyConvert()); $spotlightSearch->addSource(new \App\Spotlight\Source\OptionsSimple()); $spotlightSearch->addSource(new \App\Spotlight\Source\OptionsAutocompleteEntity()); $records = $spotlightSearch->getRecords($this->offset, $this->resultsCountPage) ; $return = []; foreach ($records as $record) { $return[]= $this->getCleanItem(null, $record->label, $record->type, $record->tooltip, [ 'jsCallback' => $record->jsCallback, 'classNames' => $record->classNames, ]); } $this->resultsCountTotal = $spotlightSearch->getLastSearchTotalCount(); return $return; } protected function getPageResultsFormatted(Array $pageResults) { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); foreach ($pageResults as $id=>$row) { $pageResults[$id]['extra'] = $_LANG['RemoteData']['AutocompleteFieldData']['index']['spotlightOptions'][$row['extra']]; } return $pageResults; } }