コード例 #1
0
ファイル: Full.php プロジェクト: nja78/magento2
 /**
  * Retrieve attribute source value for search
  *
  * @param int $attributeId
  * @param mixed $valueId
  * @param int $storeId
  * @return mixed
  */
 protected function getAttributeValue($attributeId, $valueId, $storeId)
 {
     $attribute = $this->getSearchableAttribute($attributeId);
     $value = $this->engine->processAttributeValue($attribute, $valueId);
     if ($attribute->getIsSearchable() && $attribute->usesSource() && $this->engine->allowAdvancedIndex()) {
         $attribute->setStoreId($storeId);
         $valueText = $attribute->getSource()->getIndexOptionText($valueId);
         if (is_array($valueText)) {
             $value .= $this->separator . implode($this->separator, $valueText);
         } else {
             $value .= $this->separator . $valueText;
         }
     }
     $value = preg_replace('/\\s+/siu', ' ', trim(strip_tags($value)));
     return $value;
 }