You are here

function votingapi_invoke in Voting API 5

Invoke a hook_votingapi_*() operation.

5 calls to votingapi_invoke()
votingapi_add_vote in ./votingapi.module
Add a new vote for a given piece of content. If the user has already voted, this casts an additional vote. In most cases, this should not be called directly by external modules.
votingapi_change_vote in ./votingapi.module
Alters a user's existing vote, if one exists. In most cases, this should not be called directly by external modules.
votingapi_delete_vote in ./votingapi.module
Deletes a user's existing vote, if one exists.
votingapi_recalculate_results in ./votingapi.module
Loads all votes for a given piece of content, then calculates and caches the aggregate vote results. This is only intended for modules that have assumed responsibility for the full voting cycle: the votingapi_set_vote() function recalculates…
_votingapi_get_raw_votes in ./votingapi.module
An internal utility function used to pull raw votes for processing. Undocumented at the moment..

File

./votingapi.module, line 549

Code

function votingapi_invoke($hook, &$a1, $a2 = NULL, $a3 = NULL, $a4 = NULL, $a5 = NULL, $a6 = NULL) {
  $hook = 'votingapi_' . $hook;
  foreach (module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    $result = $function($a1, $a2, $a3, $a4, $a5, $a6);
    if (is_array($result)) {
      $return = array_merge($return, $result);
    }
    else {
      if (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}