You are here

function invite_invoke_all in Invite 7.2

Invokes a hook in all modules, allowing passing arguments by reference. This function is used in place of module_invoke_all, because passing by reference does not work with that function.

Parameters

$hook: The hook to invoke.

@a1: First argument to pass to the hook.

@a2: Second argument to pass to the hook.

@a3: Third argument to pass to the hook.

Return value

A merged array containing the returned values from the invoked hooks.

1 call to invite_invoke_all()
invite_target_roles in ./invite.module
Determine target roles based on the roles of an inviter.

File

./invite.module, line 1675
Allows your users to send and track invitations to join your site.

Code

function invite_invoke_all($hook, &$a1, &$a2, &$a3) {
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    $result = $function($a1, $a2, $a3);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}