You are here

public function PaymentStorage::loadMultipleByOrder in Commerce Core 8.2

Loads all payments for the given order.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

Return value

\Drupal\commerce_payment\Entity\PaymentInterface[] The payments.

Overrides PaymentStorageInterface::loadMultipleByOrder

File

modules/payment/src/PaymentStorage.php, line 26

Class

PaymentStorage
Defines the payment storage.

Namespace

Drupal\commerce_payment

Code

public function loadMultipleByOrder(OrderInterface $order) {
  $query = $this
    ->getQuery()
    ->condition('order_id', $order
    ->id())
    ->accessCheck(FALSE)
    ->sort('payment_id');
  $result = $query
    ->execute();
  return $result ? $this
    ->loadMultiple($result) : [];
}