You are here

function node_makemeeting_delete in Make Meeting Scheduler 7

Same name and namespace in other branches
  1. 6 makemeeting.module \node_makemeeting_delete()

Implementation of hook_node_delete()

File

./makemeeting.module, line 602
Make Meeting module

Code

function node_makemeeting_delete($node) {
  $res = db_query("SELECT answer_id FROM {makemeeting_poll_rows} WHERE nid = :nid", array(
    ':nid' => $node->nid,
  ));
  foreach ($res as $answer_id_row) {
    db_query("DELETE FROM {makemeeting_poll_alters} WHERE answer_id = :answer_id", array(
      ':answer_id' => $answer_id_row->answer_id,
    ));
  }
  db_query("DELETE FROM {makemeeting_poll_rows} WHERE nid = :nid", array(
    ':nid' => $node->nid,
  ));
  db_query("DELETE FROM {makemeeting_poll_heads} WHERE nid = :nid", array(
    ':nid' => $node->nid,
  ));
  db_query("DELETE FROM {makemeeting_poll_votes} WHERE poll_id = :poll_id", array(
    ':poll_id' => $node->nid,
  ));
}