You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OrderPaymentFactory.php 873B

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Order;
  3. use App\Entity\Order\OrderPayment;
  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. $orderPayment = new OrderPayment();
  20. $orderPayment->setOrderShop($orderShop);
  21. return $orderPayment;
  22. }
  23. }