|
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Order;
-
- use Lc\CaracoleBundle\Container\Order\OrderReductionCartContainer;
- use Lc\CaracoleBundle\Model\Order\OrderReductionCartInterface;
- use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
- use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
- use Lc\SovBundle\Factory\AbstractFactory;
-
- class OrderReductionCartFactory extends AbstractFactory
- {
- // createOrderReductionCart
- public function create(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null): OrderReductionCartInterface
- {
- $class = OrderReductionCartContainer::getEntityFqcn();
- $orderReductionCart = new $class;
-
- $orderReductionCart->setOrderShop($orderShop);
- $orderReductionCart->setReductionCart($reductionCart);
- $orderReductionCart->setTitle($reductionCart->getTitle());
- $orderReductionCart->setValue($reductionCart->getValue());
- $orderReductionCart->setUnit($reductionCart->getUnit());
- $orderReductionCart->setBehaviorTaxRate($reductionCart->getBehaviorTaxRate());
- $orderReductionCart->setFreeShipping($reductionCart->getFreeShipping());
- $orderReductionCart->setAppliedTo($reductionCart->getAppliedTo());
- $orderReductionCart->setType($reductionCart->getType());
- $orderReductionCart->setCodeUsed($code);
-
- return $orderReductionCart;
- }
-
- }
|