Browse Source

OrderShop : getOrderPayments

develop
Guillaume 3 years ago
parent
commit
5fd720ef5a
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      ShopBundle/Model/OrderShop.php

+ 13
- 1
ShopBundle/Model/OrderShop.php View File

@@ -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…
Cancel
Save