/** * @param Attribute $attribute * @return string */ private function getType(Attribute $attribute) { $type = ''; $isFilterable = $attribute->getData('is_filterable') || $attribute->getData('is_filterable_in_search'); $isSearchable = $attribute->getData('is_searchable'); if ($isSearchable && $isFilterable) { $type = 'both'; } elseif ($isSearchable) { $type = 'searchable'; } elseif ($isFilterable) { $type = 'filterable'; } return $type; }