Smile\ElasticsuiteCatalog\Helper\Attribute::getIndexOptionText PHP Method

getIndexOptionText() public method

Value islocalized for a store id.
public getIndexOptionText ( Magento\Eav\Model\Entity\Attribute\AttributeInterface $attribute, integer $storeId, string | integer $optionId ) : string | boolean
$attribute Magento\Eav\Model\Entity\Attribute\AttributeInterface Product attribute.
$storeId integer Store id.
$optionId string | integer Option id.
return string | boolean
    public function getIndexOptionText(AttributeInterface $attribute, $storeId, $optionId)
    {
        $attribute = $this->getAttributeByStore($attribute, $storeId);
        $attributeId = $attribute->getAttributeId();
        if (!isset($this->attributeOptionTextCache[$storeId]) || !isset($this->attributeOptionTextCache[$storeId][$attributeId])) {
            $this->attributeOptionTextCache[$storeId][$attributeId] = [];
        }
        if (!isset($this->attributeOptionTextCache[$storeId][$attributeId][$optionId])) {
            $optionValue = $attribute->getSource()->getIndexOptionText($optionId);
            if ($this->getFieldType($attribute) == FieldInterface::FIELD_TYPE_BOOLEAN) {
                $optionValue = $attribute->getStoreLabel($storeId);
            }
            $this->attributeOptionTextCache[$storeId][$attributeId][$optionId] = $optionValue;
        }
        return $this->attributeOptionTextCache[$storeId][$attributeId][$optionId];
    }