/**
  * {@inheritdoc}
  */
 public function apply(FilterDatasourceAdapterInterface $ds, $data)
 {
     $data = $this->parseData($data);
     if (!$data) {
         return false;
     }
     $operator = $this->getOperator($data['type']);
     $ds->generateParameterName($this->getName());
     // Convert value to base unit
     if ('EMPTY' !== $operator) {
         $this->converter->setFamily($this->family);
         $baseValue = $this->converter->convertBaseToStandard($data['unit'], $data['value']);
     } else {
         $baseValue = null;
     }
     $this->util->applyFilterByAttribute($ds, $this->get(ProductFilterUtility::DATA_NAME_KEY), $baseValue, $operator);
     return true;
 }
 /**
  * @param AttributeInterface $attribute
  * @param array              $data
  *
  * @return float
  */
 protected function convertValue(AttributeInterface $attribute, array $data)
 {
     $this->measureConverter->setFamily($attribute->getMetricFamily());
     return $this->measureConverter->convertBaseToStandard($data['unit'], $data['data']);
 }