Author: Aurelien FOUCRET (aurelien.foucret@smile.fr)
コード例 #1
0
ファイル: Product.php プロジェクト: smile-sa/elasticsuite
 /**
  * {@inheritDoc}
  */
 public function loadAttributeOptions()
 {
     $productAttributes = $this->attributeList->getAttributeCollection();
     $attributes = [];
     foreach ($productAttributes as $attribute) {
         $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel();
     }
     $this->_addSpecialAttributes($attributes);
     asort($attributes);
     $this->setAttributeOption($attributes);
     return $this;
 }
コード例 #2
0
 /**
  * Retrieve ES mapping field name used for the current condition (including analyzer).
  *
  * @param ProductCondition $productCondition Product condition.
  *
  * @return string
  */
 private function getSearchFieldName(ProductCondition $productCondition)
 {
     $attributeName = $productCondition->getAttribute();
     $field = $this->attributeList->getField($attributeName);
     $analyzer = FieldInterface::ANALYZER_UNTOUCHED;
     if ($productCondition->getInputType() === "string") {
         $analyzer = FieldInterface::ANALYZER_STANDARD;
     }
     return $field->getMappingProperty($analyzer);
 }