/** * @param ProductValueInterface $productValue * @param ProductValueInterface $value */ protected function setProductMetric(ProductValueInterface $productValue, ProductValueInterface $value) { if (null === ($metric = $productValue->getMetric())) { $metric = $this->metricFactory->createMetric($value->getAttribute()->getMetricFamily()); $productValue->setMetric($metric); } $metric->setUnit($value->getMetric()->getUnit()); $metric->setData($value->getMetric()->getData()); }