Selaa lähdekoodia

Merge branch 'develop'

master
Guillaume Bourgeois 4 kuukautta sitten
vanhempi
commit
9f596722ea
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. +2
    -2
      Builder/Order/OrderShopBuilder.php
  2. +2
    -2
      Factory/Order/OrderPaymentFactory.php

+ 2
- 2
Builder/Order/OrderShopBuilder.php Näytä tiedosto

return $orderShop1; return $orderShop1;
} }


public function addPayment(OrderShopInterface $orderShop, string $meanPayment, float $amount): OrderShopInterface
public function addPayment(OrderShopInterface $orderShop, string $meanPayment, float $amount, bool $editable = false): OrderShopInterface
{ {
$orderPaymentFactory = new OrderPaymentFactory(); $orderPaymentFactory = new OrderPaymentFactory();
$orderPayment = $orderPaymentFactory->create($orderShop, $meanPayment, $amount);
$orderPayment = $orderPaymentFactory->create($orderShop, $meanPayment, $amount, $editable);


$orderShop->addOrderPayment($orderPayment); $orderShop->addOrderPayment($orderPayment);



+ 2
- 2
Factory/Order/OrderPaymentFactory.php Näytä tiedosto



class OrderPaymentFactory extends AbstractFactory class OrderPaymentFactory extends AbstractFactory
{ {
public function create(OrderShopInterface $orderShop, string $meanPayment, float $amount): OrderPaymentInterface
public function create(OrderShopInterface $orderShop, string $meanPayment, float $amount, bool $editable = false): OrderPaymentInterface
{ {
$orderPayment = $this->createBase($orderShop); $orderPayment = $this->createBase($orderShop);
$orderPayment->setMeanPayment($meanPayment); $orderPayment->setMeanPayment($meanPayment);
$orderPayment->setAmount($amount); $orderPayment->setAmount($amount);
$orderPayment->setPaidAt(new \DateTime()); $orderPayment->setPaidAt(new \DateTime());
$orderPayment->setEditable(false);
$orderPayment->setEditable($editable);


return $orderPayment; return $orderPayment;
} }

Loading…
Peruuta
Tallenna