Smile\ElasticsuiteCore\Helper\Mapping::getOptionTextFieldName PHP Method

getOptionTextFieldName() public method

Transform a field name into it's option value field form.
public getOptionTextFieldName ( string $fieldName ) : string
$fieldName string The field name to be converted.
return string
    public function getOptionTextFieldName($fieldName)
    {
        return sprintf("%s_%s", self::OPTION_TEXT_PREFIX, $fieldName);
    }

Usage Example

Example #1
0
 /**
  * ES field used in attribute autocomplete.
  *
  * @param \Magento\Catalog\Model\ResourceModel\Product\Attribute $attribute 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;
 }
All Usage Examples Of Smile\ElasticsuiteCore\Helper\Mapping::getOptionTextFieldName