You are here

function heartbeat_node_delete in Heartbeat 7

Implements hook_node_delete().

File

./heartbeat.module, line 438
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function heartbeat_node_delete($node) {

  // Delete messages from deleted nodes.
  $query = db_select('heartbeat_activity', 'ha');
  $query
    ->addField('ha', 'uaid');
  $query
    ->condition('nid', $node->nid);
  foreach ($query
    ->execute() as $row_object) {
    $uaids[] = $row_object->uaid;
  }
  if (!empty($uaids)) {
    heartbeat_activity_delete($uaids);
  }
}