You are here

function heartbeat_activity_delete in Heartbeat 7

Deletes a heartbeat activity messages.

Parameters

Array $uaids: User activity IDs

Boolean $all: Indicates whether all activity should be deleted.

5 calls to heartbeat_activity_delete()
heartbeat_activity_delete_all_confirm_submit in modules/heartbeat_ui/heartbeat_ui.admin.inc
Submit callback to delete all activity logged to the table {heartbeat_activity}.
heartbeat_cron in ./heartbeat.module
Implements hook_cron(). Delete too old message if this option is set and logs where the node does not exist anymore.
heartbeat_delete_log_confirm_submit in ./heartbeat.pages.inc
Handler for wipe confirmation
heartbeat_node_delete in ./heartbeat.module
Implements hook_node_delete().
heartbeat_user_delete in ./heartbeat.module
Implements hook_user_delete().

File

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

Code

function heartbeat_activity_delete($uaids = array(), $all = FALSE) {

  // We don't delete all messages when not intended.
  if (empty($uaids) && $all == FALSE) {
    return;
  }
  $query = db_delete('heartbeat_activity');
  if (!empty($uaids) && $all == FALSE) {
    $query
      ->condition('uaid', $uaids, 'IN');
  }
  $query
    ->execute();

  //->where(" ha.message_id NOT IN (:messages) ", array(':messages' => $denied_messages));

  // Allow modules to respond to the deleting of a heartbeat activity message.
  module_invoke_all('heartbeat_activity_delete', $uaids, $all);
}