You are here

function votingapi_delete_results in Voting API 7.2

Same name and namespace in other branches
  1. 6.2 votingapi.module \votingapi_delete_results()
  2. 6 votingapi.module \votingapi_delete_results()

Delete cached vote results from the database.

Parameters

$vote_results: An array of vote results to delete. Minimally, each vote result must have the 'vote_cache_id' key set.

1 call to votingapi_delete_results()
_votingapi_delete_cache_by_entity in ./votingapi.module
Helper function to delete all cache entries on given entities.

File

./votingapi.module, line 382
A generalized voting API for Drupal.

Code

function votingapi_delete_results($vote_results = array()) {
  if (!empty($vote_results)) {
    $vids = array();
    foreach ($vote_results as $vote) {
      $vids[] = $vote['vote_cache_id'];
    }
    db_delete('votingapi_cache')
      ->condition('vote_cache_id', $vids, 'IN')
      ->execute();
  }
}