Smile\ElasticsuiteCatalog\Model\Layer\Filter\DecimalFilterTrait::_getItemsData PHP Method

_getItemsData() protected method

protected _getItemsData ( ) : array
return array
    protected function _getItemsData()
    {
        $attribute = $this->getAttributeModel();
        $this->_requestVar = $attribute->getAttributeCode();
        /** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
        $productCollection = $this->getLayer()->getProductCollection();
        $facets = $productCollection->getFacetedData($this->getFilterField());
        $minValue = false;
        $maxValue = false;
        $data = [];
        if (count($facets) > 1) {
            foreach ($facets as $key => $aggregation) {
                $count = $aggregation['count'];
                $data[] = ['label' => $key, 'value' => $key, 'count' => $count];
                if ($minValue === false || $minValue > $key) {
                    $minValue = $key;
                }
                if ($maxValue === false || $maxValue < $key) {
                    $maxValue = $key;
                }
            }
            $this->setMinValue($minValue);
            $this->setMaxValue($maxValue);
        }
        return $data;
    }
DecimalFilterTrait