Smile\ElasticsuiteCatalog\Helper\Autocomplete::getAttributeAutocompleteField PHP Method

getAttributeAutocompleteField() public method

ES field used in attribute autocomplete.
public getAttributeAutocompleteField ( Magento\Catalog\Api\Data\ProductAttributeInterface $attribute ) : string
$attribute Magento\Catalog\Api\Data\ProductAttributeInterface Attribute.
return string
    public function getAttributeAutocompleteField(\Magento\Catalog\Api\Data\ProductAttributeInterface $attribute)
    {
        $fieldName = $attribute->getAttributeCode();
        if ($attribute->usesSource()) {
            $fieldName = $this->mappingHelper->getOptionTextFieldName($fieldName);
        }
        return $fieldName;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Get filter field for an attribute.
  *
  * @param Magento\Catalog\Model\ResourceModel\Product\Attribute $attribute Product attribute.
  *
  * @return string
  */
 private function getFilterField($attribute)
 {
     return $this->autocompleteHelper->getAttributeAutocompleteField($attribute);
 }