You are here

function payment_method_controllers_info in Payment 7

Returns information about payment method controllers.

Return value

array Keys are payment method controller class aliases, values are the real payment method controller class names. This allows hook_payment_method_controller_info_alter() to override payment method controllers.

2 calls to payment_method_controllers_info()
PaymentMethodController::descendants in ./payment.classes.inc
Returns an array with the names of all available payment method controllers that inherit of this one.
payment_method_controller_load_multiple in ./payment.module
Load multiple payment method controllers.

File

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

Code

function payment_method_controllers_info() {
  $controllers_info =& drupal_static(__FUNCTION__);
  if (!$controllers_info) {
    $controllers_info = module_invoke_all('payment_method_controller_info');
    foreach ($controllers_info as $controller_class_name_alias => $controller_class_name) {
      if (is_numeric($controller_class_name_alias)) {
        unset($controllers_info[$controller_class_name_alias]);
        $controllers_info[$controller_class_name] = $controller_class_name;
      }
    }
    drupal_alter('payment_method_controller_info', $controllers_info);
  }
  return $controllers_info;
}