Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

OrderProductBuilder.php 996B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Lc\CaracoleBundle\Builder\Order;
  3. use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
  4. use Lc\CaracoleBundle\Resolver\Price\PriceResolver;
  5. class OrderProductBuilder
  6. {
  7. protected PriceResolver $priceResolver;
  8. public function __construct(PriceResolver $priceResolver)
  9. {
  10. $this->priceResolver = $priceResolver;
  11. }
  12. public function init(OrderProductInterface $orderProduct)
  13. {
  14. $orderProduct->setTitle($orderProduct->getTitleOrderShop());
  15. $orderProduct->setPrice($this->priceResolver->getPrice($orderProduct->getProduct()));
  16. $orderProduct->setBuyingPrice($this->priceResolver->getBuyingPrice($orderProduct->getProduct()));
  17. $orderProduct->setUnit($orderProduct->getProduct()->getUnitInherited());
  18. $orderProduct->setTaxRate($orderProduct->getProduct()->getTaxRateInherited());
  19. $orderProduct->setQuantityProduct($orderProduct->getProduct()->getQuantityInherited());
  20. return $orderProduct;
  21. }
  22. }