Просмотр исходного кода

Refactoring OrderPayment : editable

develop
Guillaume Bourgeois 10 месяцев назад
Родитель
Сommit
ae75e5401e
2 измененных файлов: 4 добавлений и 4 удалений
  1. +2
    -2
      Builder/Order/OrderShopBuilder.php
  2. +2
    -2
      Factory/Order/OrderPaymentFactory.php

+ 2
- 2
Builder/Order/OrderShopBuilder.php Просмотреть файл

@@ -358,10 +358,10 @@ class OrderShopBuilder
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();
$orderPayment = $orderPaymentFactory->create($orderShop, $meanPayment, $amount);
$orderPayment = $orderPaymentFactory->create($orderShop, $meanPayment, $amount, $editable);

$orderShop->addOrderPayment($orderPayment);


+ 2
- 2
Factory/Order/OrderPaymentFactory.php Просмотреть файл

@@ -9,13 +9,13 @@ use Lc\SovBundle\Factory\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->setMeanPayment($meanPayment);
$orderPayment->setAmount($amount);
$orderPayment->setPaidAt(new \DateTime());
$orderPayment->setEditable(false);
$orderPayment->setEditable($editable);

return $orderPayment;
}

Загрузка…
Отмена
Сохранить