You are here

function uc_recurring_get_recurring_info in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 uc_recurring.module \uc_recurring_get_recurring_info()

Get the recurring handlers info.

Return value

Array keyed by the implementing module, and the callback.

7 calls to uc_recurring_get_recurring_info()
uc_recurring_get_fee_ops in ./uc_recurring.module
Provide default options.
uc_recurring_invoke in ./uc_recurring.module
Invoke an item type specific function, which will be item types base appended with _$op. The parameters given in $params will be passed to this function.
uc_recurring_menu in ./uc_recurring.module
Implements hook_menu().
uc_recurring_order_process_order in modules/uc_recurring_order/uc_recurring_order.module
Process a recurring order.
uc_recurring_payment_form in ./uc_recurring.admin.inc
Recurring payment settings form.

... See full list

File

./uc_recurring.module, line 643
Allows you to add a recurring fee to a product/SKU to handle subscription type services.

Code

function uc_recurring_get_recurring_info($key = '', $reset = FALSE) {
  static $data = array();
  if ($reset || $key && empty($data[$key]) || !$key && empty($data)) {
    $data = array();
    foreach (module_implements('recurring_info') as $module) {
      if ($result = module_invoke($module, 'recurring_info')) {
        $data[] = $result;
      }
    }

    // Get uc recurring own implementation. The pattern of the function is
    // uc_recurring_MODULE-NAME_recurring_info().
    if ($modules = uc_recurring_includes()) {
      foreach ($modules as $module) {
        $func = 'uc_recurring_' . $module . '_recurring_info';
        if (function_exists($func) && ($result = call_user_func($func))) {
          $data[] = $result;
        }
      }
    }

    // Normalize data array to be keyed by the fee handler name.
    $data = _uc_recurring_get_recurring_info_handlers($data);
    drupal_alter('recurring_info', $data);
  }
  if (!empty($key)) {
    $return = !empty($data[$key]) ? $data[$key] : array();
  }
  else {
    $return = $data;
  }
  return $return;
}