public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
    {
        $type        = $attribute->getBackendType();
        $aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation;

        if ($attribute->getBackendType() == 'varchar' && $attribute->getFrontendClass() == 'validate-number') {
            $aggregation = $this->aggregations['decimal'];
        }

        if ($attribute->getBackendType() == 'static' && $attribute->getAttributeCode() == 'category_ids') {
            $aggregation = $this->aggregations['category'];
        }

        if ($attribute->getAttributeCode() == 'price') {
            $aggregation = $this->aggregations['price'];
        }

        if (!($aggregation instanceof AggregationInterface)) {
            throw new \InvalidArgumentException(
                'Aggregation must implement ' . AggregationInterface::class
            );
        }

        return $aggregation->getAggregationData($attribute);
    }
public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
    {
        $type        = $attribute->getBackendType();
        $aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation;

        if ($attribute->getBackendType() == 'varchar' && $attribute->getFrontendClass() == 'validate-number') {
            $aggregation = $this->aggregations['decimal'];
        }

        if ($attribute->getBackendType() == 'static' && $attribute->getAttributeCode() == 'category_ids') {
            $aggregation = $this->aggregations['category'];
        }

        if ($attribute->getAttributeCode() == 'price') {
            $aggregation = $this->aggregations['price'];
        }

        if (!($aggregation instanceof AggregationInterface)) {
            throw new \InvalidArgumentException(
                'Aggregation must implement ' . AggregationInterface::class
            );
        }

        return $aggregation->getAggregationData($attribute);
    }
public function getAggregationData ( \ Magento \ Catalog \ Model \ ResourceModel \ Eav \ Attribute $ attribute ) { $ type = $ attribute -> getBackendType ( ) ; $ aggregation = isset ( $ this -> aggregations [ $ type ] ) ? $ this -> aggregations [ $ type ] : $ this -> defaultAggregation ; if ( $ attribute -> getBackendType ( ) == 'varchar' && $ attribute -> getFrontendClass ( ) == 'validate-number' ) { $ aggregation = $ this -> aggregations [ 'decimal' ] ; } if ( $ attribute -> getBackendType ( ) == 'static' && $ attribute -> getAttributeCode ( ) == 'category_ids' ) { $ aggregation = $ this -> aggregations [ 'category' ] ; } if ( $ attribute -> getAttributeCode ( ) == 'price' ) { $ aggregation = $ this -> aggregations [ 'price' ] ; } if ( ! ( $ aggregation instanceof AggregationInterface ) ) { throw new \ InvalidArgumentException ( 'Aggregation must implement ' . AggregationInterface :: class ) ; } return $ aggregation -> getAggregationData ( $ attribute ) ; }
Get Aggregation Data for a given product attribute.

@param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute Product EAV Attribute

@return array
Get Aggregation Data for a given product attribute .