You are here

function file_download_counter_file_predelete in File Download 8

Implements hook_ENTITY_TYPE_predelete() for node entities.

File

modules/file_download_counter/file_download_counter.module, line 107
Logs and displays content file_download_counter for a site.

Code

function file_download_counter_file_predelete(EntityInterface $file) {

  // Clean up file_download_counter table when node is deleted.
  \Drupal::database()
    ->delete('file_download_counter')
    ->condition('fid', $file
    ->id())
    ->execute();
}