You are here

function votingapi_entity_delete in Voting API 7.3

Same name and namespace in other branches
  1. 8.3 votingapi.module \votingapi_entity_delete()
  2. 7.2 votingapi.module \votingapi_entity_delete()

Implements hook_entity_delete().

Delete all votes and cache entries for the deleted entities

File

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

Code

function votingapi_entity_delete($entity, $type) {
  $ids = entity_extract_ids($type, $entity);
  $id = array(
    $ids[0],
  );
  VotingApi_ResultCriteria::byEntity($type, $ids)
    ->delete();
  VotingApi_Criteria::byEntity($type, $ids)
    ->delete();
}