Przeglądaj źródła

OrderShop : getOrderPayments

develop
Guillaume 3 lat temu
rodzic
commit
5fd720ef5a
1 zmienionych plików z 13 dodań i 1 usunięć
  1. +13
    -1
      ShopBundle/Model/OrderShop.php

+ 13
- 1
ShopBundle/Model/OrderShop.php Wyświetl plik

@@ -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;
}


Ładowanie…
Anuluj
Zapisz