You are here

function payment_status_is_or_has_ancestor in Payment 7

Check if a payment status is equal to a given other status or has it one of its ancestors.

Parameters

string $status: The payment status.

string $ancestor_status: The ancestor status to check for.

Return value

boolean

4 calls to payment_status_is_or_has_ancestor()
hook_payment_pre_finish in ./payment.api.php
Executes right before payment execution is finished.
paymentform_payment_finish in modules/paymentform/paymentform.module
Implements Payment::finish_callback.
payment_form_embedded in ./payment.ui.inc
Builds common elements for a payment add/edit form.
payment_form_standalone_submit in ./payment.ui.inc
Implements form submit callback for payment_form().

File

./payment.module, line 789
Hook implementations and shared functions.

Code

function payment_status_is_or_has_ancestor($status, $ancestor_status) {
  return $status == $ancestor_status || in_array($ancestor_status, payment_status_info($status, TRUE)
    ->ancestors());
}