/** * {@inheritDoc} */ public function getItems() { $items = []; foreach ($this->attributeCollection as $attribute) { $filterField = $this->getFilterField($attribute); $facetData = $this->productCollection->getFacetedData($filterField); foreach ($facetData as $currentFilter) { if ($currentFilter['value'] != '__other_docs') { $currentFilter['attribute_code'] = $attribute->getAttributeCode(); $currentFilter['attribute_label'] = $attribute->getStoreLabel(); $currentFilter['type'] = $this->getType(); $items[] = $this->itemFactory->create($currentFilter); } } } uasort($items, [$this, 'resultSorterCallback']); return array_slice($items, 0, $this->getResultsPageSize()); }