You are here

function casetracker_comment_delete in Case Tracker 7

Implements hook_comment_delete().

File

./casetracker.module, line 465
Enables the handling of projects and their cases.

Code

function casetracker_comment_delete($comment) {

  // Load the node here anyway -- it is almost certainly static cached already.
  $node = is_array($comment) ? node_load($comment['nid']) : node_load($comment->nid);

  // Bail if this is not a casetracker node.
  if (!casetracker_is_case($node->type)) {
    return;
  }

  // @todo theoretically, if you delete a comment, we should reset all the values
  // to what they were before the comment was submitted. this doesn't happen yet.
  db_delete('casetracker_comment_status')
    ->condition('cid', $comment->cid)
    ->execute();
}