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.

OrderPaymentFactory.php 948B

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
1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
  4. use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
  5. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  6. use Lc\SovBundle\Factory\AbstractFactory;
  7. class OrderPaymentFactory extends AbstractFactory
  8. {
  9. public function create(OrderShopInterface $orderShop, string $meanPayment, float $amount): OrderPaymentInterface
  10. {
  11. $orderPayment = $this->createBase($orderShop);
  12. $orderPayment->setMeanPayment($meanPayment);
  13. $orderPayment->setAmount($amount);
  14. $orderPayment->setPaidAt(new \DateTime());
  15. $orderPayment->setEditable(false);
  16. return $orderPayment;
  17. }
  18. public function createBase($orderShop){
  19. $class = OrderPaymentContainer::getEntityFqcn();
  20. $orderPayment = new $class;
  21. $orderPayment->setOrderShop($orderShop);
  22. return $orderPayment;
  23. }
  24. }