Beispiel #1
0
 /**
  * Parse attribute to get mapping field creation parameters.
  *
  * @param AttributeInterface $attribute Product attribute.
  *
  * @return array
  */
 public function getMappingFieldOptions(AttributeInterface $attribute)
 {
     $options = ['is_searchable' => $attribute->getIsSearchable(), 'is_filterable' => $attribute->getIsFilterable() || $attribute->getIsFilterableInSearch(), 'search_weight' => $attribute->getSearchWeight(), 'is_used_for_sort_by' => $attribute->getUsedForSortBy()];
     if ($attribute->getIsUsedInSpellcheck()) {
         $options['is_used_in_spellcheck'] = true;
     }
     if ($attribute->getIsUsedInAutocomplete()) {
         $options['is_used_in_autocomplete'] = true;
     }
     return $options;
 }