You are here

function payment_rules_condition_payment_status_has_ancestor in Payment 7

Implements Rules condition callback: check whether a payment's status is a child of any of the selected statuses.

Parameters

Payment $payment: The payment to check the condition for.

array $payment_statuses: An array with payment statuses.

Return value

boolean

File

./payment.rules.inc, line 361
Rules integration.

Code

function payment_rules_condition_payment_status_has_ancestor(Payment $payment, array $payment_statuses) {
  foreach ($payment_statuses as $payment_status) {
    if (payment_status_has_ancestor($payment
      ->getStatus()->status, $payment_status)) {
      return TRUE;
    }
  }
  return FALSE;
}