function statistics_node_predelete
Same name in other branches
- 8.9.x core/modules/statistics/statistics.module \statistics_node_predelete()
- 10 core/modules/statistics/statistics.module \statistics_node_predelete()
- 11.x core/modules/statistics/statistics.module \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.