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.

OrderReductionCartFactory.php 1.4KB

3 anos atrás
3 anos atrás
3 anos atrás
3 anos atrás
3 anos atrás
3 anos atrás
3 anos atrás
123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use Lc\CaracoleBundle\Container\Order\OrderReductionCartContainer;
  4. use Lc\CaracoleBundle\Model\Order\OrderReductionCartInterface;
  5. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  6. use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
  7. use Lc\SovBundle\Factory\AbstractFactory;
  8. class OrderReductionCartFactory extends AbstractFactory
  9. {
  10. // createOrderReductionCart
  11. public function create(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null): OrderReductionCartInterface
  12. {
  13. $class = OrderReductionCartContainer::getEntityFqcn();
  14. $orderReductionCart = new $class;
  15. $orderReductionCart->setOrderShop($orderShop);
  16. $orderReductionCart->setReductionCart($reductionCart);
  17. $orderReductionCart->setTitle($reductionCart->getTitle());
  18. $orderReductionCart->setValue($reductionCart->getValue());
  19. $orderReductionCart->setUnit($reductionCart->getUnit());
  20. $orderReductionCart->setBehaviorTaxRate($reductionCart->getBehaviorTaxRate());
  21. $orderReductionCart->setFreeShipping($reductionCart->getFreeShipping());
  22. $orderReductionCart->setAppliedTo($reductionCart->getAppliedTo());
  23. $orderReductionCart->setType($reductionCart->getType());
  24. $orderReductionCart->setCodeUsed($code);
  25. return $orderReductionCart;
  26. }
  27. }