function tracker_node_predelete

Same name in other branches
  1. 9 core/modules/tracker/tracker.module \tracker_node_predelete()
  2. 10 core/modules/tracker/tracker.module \tracker_node_predelete()
  3. 11.x core/modules/tracker/tracker.module \tracker_node_predelete()

Implements hook_ENTITY_TYPE_predelete() for node entities.

Deletes tracking information for a node.

File

core/modules/tracker/tracker.module, line 205

Code

function tracker_node_predelete(EntityInterface $node, $arg = 0) {
    $connection = \Drupal::database();
    $connection->delete('tracker_node')
        ->condition('nid', $node->id())
        ->execute();
    $connection->delete('tracker_user')
        ->condition('nid', $node->id())
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.