Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- <?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;
- }
- }
|