ソースを参照

Refactoring OrderPayment : editable

develop
Guillaume Bourgeois 4ヶ月前
コミット
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;
}

読み込み中…
キャンセル
保存