Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

30 rindas
1.2KB

  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. }