You are here

function heartbeat_messages_uninstall in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.2 heartbeat.module \heartbeat_messages_uninstall()
  2. 6.3 heartbeat.module \heartbeat_messages_uninstall()

Function to uninstall default records

2 calls to heartbeat_messages_uninstall()
heartbeat_messages_revert in ./heartbeat.admin.inc
Revert a heartbeat message back to default
_heartbeat_messages_rebuild in ./heartbeat.module
Rebuild the messages and check their status

File

./heartbeat.module, line 1501

Code

function heartbeat_messages_uninstall($id, $type = 'module') {
  if ($type == 'module') {
    $success = db_query("DELETE FROM {heartbeat_messages} WHERE module = '%s'", $id);
  }
  if ($type == 'message' || $type == 'message_id') {
    $success = db_query("DELETE FROM {heartbeat_messages} WHERE message_id = '%s'", $id);
  }

  // Add an entry to the watchdog log.
  watchdog('heartbeat', 'Heartbeat: message template %id deleted.', array(
    '%id' => $id,
  ), WATCHDOG_NOTICE);
  return $success;
}