コード例 #1
0
 /**
  * @param QuoteProductOffer|null $offer
  * @return array
  */
 protected function createResponseData(QuoteProductOffer $offer = null)
 {
     if (!$offer) {
         return [];
     }
     $price = $offer->getPrice();
     if (!$price) {
         return [];
     }
     $formatter = $this->get('oro_locale.formatter.number');
     return ['id' => $offer->getId(), 'unit' => $offer->getProductUnitCode(), 'qty' => $offer->getQuantity(), 'price' => $formatter->formatCurrency($price->getValue(), $price->getCurrency())];
 }