function statistics_node_predelete

statistics_node_predelete(EntityInterface $node)

Implements hook_ENTITY_TYPE_predelete() for node entities.

File

core/modules/statistics/statistics.module, line 152
Logs and displays content statistics for a site.

Code

function statistics_node_predelete(EntityInterface $node) {
  // Clean up statistics table when node is deleted.
  db_delete('node_counter')
    ->condition('nid', $node->id())
    ->execute();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!statistics!statistics.module/function/statistics_node_predelete/8.1.x