You are here

function advpoll_delete in Advanced Poll 6.2

Same name and namespace in other branches
  1. 5 advpoll.module \advpoll_delete()
  2. 6.3 advpoll.module \advpoll_delete()
  3. 6 advpoll.module \advpoll_delete()

Implementation of hook_delete().

File

./advpoll.module, line 844
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function advpoll_delete($node) {
  db_query('DELETE FROM {advpoll} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {advpoll_choices} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {advpoll_electoral_list} WHERE nid = %d', $node->nid);

  // TODO: These should be converted to a votingapi method eventually.
  db_query("DELETE FROM {votingapi_vote} WHERE content_id = %d AND content_type = 'advpoll'", $node->nid);
  db_query("DELETE FROM {votingapi_cache} WHERE content_id = %d AND content_type = 'advpoll'", $node->nid);
}