/** * Generate dynamic fields requests * * @return array */ public function generate() { $requests = []; foreach ($this->indexPool->getAvailableIndexes() as $index) { $requests[$index->getCode()] = $this->generateQuickSearchRequest($index); } return $requests; }
/** * To option array * * @param bool $onlyUnused * @return array */ public function toOptionArray($onlyUnused = false) { $options = []; foreach ($this->pool->getAvailableIndexes() as $index) { $code = $index->getCode(); if (!$onlyUnused || !$this->indexCollection->getItemByColumnValue('code', $code)) { $options[$code] = $index->toString(); } } return $options; }