You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace Lc\CaracoleBundle\Builder\Order;
-
- use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
- use Lc\CaracoleBundle\Resolver\Price\PriceResolver;
-
- class OrderProductBuilder
- {
- protected PriceResolver $priceResolver;
-
- public function __construct(PriceResolver $priceResolver)
- {
- $this->priceResolver = $priceResolver;
- }
-
- public function init(OrderProductInterface $orderProduct)
- {
- $orderProduct->setTitle($orderProduct->getTitleOrderShop());
- $orderProduct->setPrice($this->priceResolver->getPrice($orderProduct->getProduct()));
- $orderProduct->setBuyingPrice($this->priceResolver->getBuyingPrice($orderProduct->getProduct()));
- $orderProduct->setUnit($orderProduct->getProduct()->getUnitInherited());
- $orderProduct->setTaxRate($orderProduct->getProduct()->getTaxRateInherited());
- $orderProduct->setQuantityProduct($orderProduct->getProduct()->getQuantityInherited());
-
- return $orderProduct;
- }
- }
|