1 comment.module comment_node_predelete(Node $node)

Implements hook_node_predelete().

File

core/modules/comment/comment.module, line 1404
Enables users to comment on published content.

Code

function comment_node_predelete(Node $node) {
  $cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid))->fetchCol();
  comment_delete_multiple($cids);
  db_delete('node_comment_statistics')
    ->condition('nid', $node->nid)
    ->execute();
}