瀏覽代碼

OrderShop : getOrderPayments

develop
Guillaume 3 年之前
父節點
當前提交
5fd720ef5a
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. +13
    -1
      ShopBundle/Model/OrderShop.php

+ 13
- 1
ShopBundle/Model/OrderShop.php 查看文件

@@ -303,8 +303,20 @@ abstract class OrderShop extends AbstractEntity implements FilterMerchantInterfa
/**
* @return Collection|OrderPayment[]
*/
public function getOrderPayments(): Collection
public function getOrderPayments($meanPayment = null): Collection
{
if($meanPayment) {
$orderPaymentsReturn = new ArrayCollection() ;

foreach($this->orderPayments as $orderPayment) {
if($orderPayment->getMeanPayment() == $meanPayment) {
$orderPaymentsReturn[] = $orderPayment ;
}
}

return $orderPaymentsReturn ;
}

return $this->orderPayments;
}


Loading…
取消
儲存