You are here

function Payment::getLineItems in Payment 7

Get line items.

Parameters

string|null $name (optional): The requested line item(s)'s machine name, as possibly defined in hook_payment_line_item_info(). If $name is NULL, then all line items will be returned.

Return value

PaymentLineItem[] An array with matching PaymentLineItem objects.

File

./payment.classes.inc, line 215
The API and related functions for executing and managing payments.

Class

Payment
A single payment. Contains all payment-specific data.

Code

function getLineItems($name = NULL) {
  if (is_null($name)) {
    return payment_line_item_get_all($name, $this);
  }
  elseif ($line_item_info = payment_line_item_info($name)) {
    return call_user_func($line_item_info->callback, $name, $this);
  }
  else {
    return payment_line_item_get_specific($name, $this);
  }
}