function uc_payment_load_payments in Ubercart 8.4
Same name and namespace in other branches
- 5 payment/uc_payment/uc_payment.module \uc_payment_load_payments()
- 6.2 payment/uc_payment/uc_payment.module \uc_payment_load_payments()
- 7.3 payment/uc_payment/uc_payment.module \uc_payment_load_payments()
Loads an array of all the payments for an order.
Parameters
int $order_id: The order's id.
Return value
\Drupal\uc_payment\PaymentReceiptInterface[] Array of PaymentReceipt entities.
4 calls to uc_payment_load_payments()
- hook_uc_order_can_delete in uc_order/
uc_order.api.php - Verifies whether an order may be deleted.
- OrderPaymentsForm::buildForm in payment/
uc_payment/ src/ Form/ OrderPaymentsForm.php - Form constructor.
- uc_payment_balance in payment/
uc_payment/ uc_payment.module - Returns the balance of payments on an order.
- uc_payment_uc_order_can_delete in payment/
uc_payment/ uc_payment.module - Implements hook_uc_order_can_delete().
File
- payment/
uc_payment/ uc_payment.module, line 309 - Defines the payment API that lets payment modules interact with Ubercart.
Code
function uc_payment_load_payments($order_id) {
$result = \Drupal::entityQuery('uc_payment_receipt')
->condition('order_id', $order_id)
->sort('receipt_id')
->execute();
if (!empty($result)) {
$storage = \Drupal::entityTypeManager()
->getStorage('uc_payment_receipt');
return $storage
->loadMultiple(array_keys($result));
}
return [];
}