Beispiel #1
0
 /**
  * @param array $aggregations
  * @param array $requestParameters
  *
  * @return \Spryker\Shared\Transfer\TransferInterface
  */
 public function extractDataFromAggregations(array $aggregations, array $requestParameters)
 {
     $parameterName = $this->facetConfigTransfer->getParameterName();
     $fieldName = $this->facetConfigTransfer->getFieldName();
     list($min, $max) = $this->extractRangeData($aggregations, $parameterName, $fieldName);
     $rangeResultTransfer = new RangeSearchResultTransfer();
     $rangeResultTransfer->setName($parameterName)->setMin($min)->setMax($max);
     return $rangeResultTransfer;
 }
Beispiel #2
0
 /**
  * @param array $aggregations
  * @param array $requestParameters
  *
  * @return \Spryker\Shared\Transfer\TransferInterface
  */
 public function extractDataFromAggregations(array $aggregations, array $requestParameters)
 {
     $parameterName = $this->facetConfigTransfer->getParameterName();
     $facetResultValueTransfers = $this->extractFacetData($aggregations);
     $facetResultTransfer = new FacetSearchResultTransfer();
     $facetResultTransfer->setName($parameterName)->setValues($facetResultValueTransfers);
     if (isset($requestParameters[$parameterName])) {
         $facetResultTransfer->setActiveValue($requestParameters[$parameterName]);
     }
     return $facetResultTransfer;
 }