Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

OrderReductionCreditFactory.php 1.2KB

3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use Lc\CaracoleBundle\Container\Order\OrderReductionCreditContainer;
  4. use Lc\CaracoleBundle\Model\Order\OrderReductionCreditInterface;
  5. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  6. use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
  7. use Lc\SovBundle\Factory\AbstractFactory;
  8. class OrderReductionCreditFactory extends AbstractFactory
  9. {
  10. public function create(OrderShopInterface $orderShop, ReductionCreditInterface $reductionCredit): OrderReductionCreditInterface
  11. {
  12. $class = OrderReductionCreditContainer::getEntityFqcn();
  13. $orderReductionCredit = new $class;
  14. $orderReductionCredit->setOrderShop($orderShop);
  15. $orderReductionCredit->setReductionCredit($reductionCredit);
  16. $orderReductionCredit->setTitle($reductionCredit->getTitle());
  17. $orderReductionCredit->setValue($reductionCredit->getValue());
  18. $orderReductionCredit->setUnit($reductionCredit->getUnit());
  19. $orderReductionCredit->setBehaviorTaxRate($reductionCredit->getBehaviorTaxRate());
  20. $orderReductionCredit->setType($reductionCredit->getType());
  21. return $orderReductionCredit;
  22. }
  23. }