/** * @param array $drupalProduct * @param ProductValue $productValue * @param string $field * @param array $context */ public function normalize(array &$drupalProduct, $productValue, $field, array $context = array()) { $prices = $productValue->getPrices(); /** @var ProductPrice $price */ foreach ($prices as $price) { $drupalProduct['values'][$field][$context['locale']][] = ['type' => 'pim_catalog_price_collection', 'amount' => (double) $price->getData(), 'currency' => $price->getCurrency()]; } }
/** * {@inheritDoc} */ public function getPrices() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPrices', array()); return parent::getPrices(); }