You are here

function voting_rules_votingapi_results in Voting Rules 7

Same name and namespace in other branches
  1. 6 voting_rules.module \voting_rules_votingapi_results()

Implements hook_votingapi_results().

File

./voting_rules.module, line 48
Voting Rules module.

Code

function voting_rules_votingapi_results($cached, $entity_type, $entity_id) {
  $vote_results = array();
  $entity = voting_rules_load_entity($entity_type, $entity_id);
  foreach ($cached as $result) {
    $vote_results[$result['function']] = $result;
  }
  if ($entity) {
    rules_invoke_event('voting_rules_results_' . $entity_type, $vote_results, $entity);
  }
}