function statistics_node_predelete

Implements hook_ENTITY_TYPE_predelete() for node entities.

File

core/modules/statistics/statistics.module, line 82

Code

function statistics_node_predelete(EntityInterface $node) {
  // Clean up statistics table when node is deleted.
  $id = $node->id();
  return \Drupal::service('statistics.storage.node')->deleteViews($id);
}

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