You are here

function payment_status_has_ancestor in Payment 7

Check if a payment status has a given other status as one of its ancestors.

Parameters

string $status: The payment status.

string $ancestor_status: The ancestor status to check for.

Return value

boolean

1 call to payment_status_has_ancestor()
payment_rules_condition_payment_status_has_ancestor in ./payment.rules.inc
Implements Rules condition callback: check whether a payment's status is a child of any of the selected statuses.

File

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

Code

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