You are here

function voting_rules_get_votes in Voting Rules 7

Rules callback to get votes on an entity.

1 string reference to 'voting_rules_get_votes'
voting_rules_rules_data_info_alter in ./voting_rules.rules.inc
Implemnts hook_rules_data_info_alter().

File

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

Code

function voting_rules_get_votes($entity, array $options, $name, $entity_type) {
  $entity_key = voting_rules_get_entity_key($entity_type);
  $votes = votingapi_select_votes(array(
    'entity_id' => $entity->{$entity_key},
    'entity_type' => $entity_type,
  ));
  return $votes;
}