You are here

function oa_notifications_node_delete in Open Atrium Notifications 7.2

Implements hook_node_delete().

Cleanup the notifications for teams and groups as they are removed.

File

./oa_notifications.module, line 468

Code

function oa_notifications_node_delete($node) {
  if ($node->type == OA_TEAM_TYPE) {
    $target_type = 'team';
  }
  elseif ($node->type == OA_GROUP_TYPE) {
    $target_type = 'group';
  }
  if (isset($target_type)) {
    oa_notifications_delete_for_target($node->nid, $target_type);
  }
}