You are here

public function NodeStatisticsDatabaseStorage::deleteViews in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/statistics/src/NodeStatisticsDatabaseStorage.php \Drupal\statistics\NodeStatisticsDatabaseStorage::deleteViews()

Delete counts for a specific entity.

Parameters

int $id: The ID of the entity which views to delete.

Return value

bool TRUE if the entity views have been deleted.

Overrides StatisticsStorageInterface::deleteViews

File

core/modules/statistics/src/NodeStatisticsDatabaseStorage.php, line 110

Class

NodeStatisticsDatabaseStorage
Provides the default database storage backend for statistics.

Namespace

Drupal\statistics

Code

public function deleteViews($id) {
  return (bool) $this->connection
    ->delete('node_counter')
    ->condition('nid', $id)
    ->execute();
}