function statistics_node_predelete in Drupal 8
Same name and namespace in other branches
- 9 core/modules/statistics/statistics.module \statistics_node_predelete()
Implements hook_ENTITY_TYPE_predelete() for node entities.
File
- core/
modules/ statistics/ statistics.module, line 153 - Logs and displays content statistics for a site.
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);
}