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->getIsDisplayedInAutocomplete()) {
            $options['is_filterable'] = true;
        }

        if ($attribute->getUsedForSortBy()) {
            $options['sort_order_asc_missing']  = $attribute->getSortOrderAscMissing();
            $options['sort_order_desc_missing'] = $attribute->getSortOrderDescMissing();
        }

        return $options;
    }
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->getIsDisplayedInAutocomplete()) {
            $options['is_filterable'] = true;
        }

        if ($attribute->getUsedForSortBy()) {
            $options['sort_order_asc_missing']  = $attribute->getSortOrderAscMissing();
            $options['sort_order_desc_missing'] = $attribute->getSortOrderDescMissing();
        }

        return $options;
    }
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 -> getIsDisplayedInAutocomplete ( ) ) { $ options [ 'is_filterable' ] = true ; } if ( $ attribute -> getUsedForSortBy ( ) ) { $ options [ 'sort_order_asc_missing' ] = $ attribute -> getSortOrderAscMissing ( ) ; $ options [ 'sort_order_desc_missing' ] = $ attribute -> getSortOrderDescMissing ( ) ; } return $ options ; }
Parse attribute to get mapping field creation parameters.

@param AttributeInterface $attribute Product attribute.

@return array
Parse attribute to get mapping field creation parameters .