file_mdm.module in File metadata manager 8
Same filename and directory in other branches
Provides a service to manage file metadata.
File
file_mdm.moduleView source
<?php
/**
* @file
* Provides a service to manage file metadata.
*/
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_cache_flush().
*/
function file_mdm_cache_flush() {
return [
'file_mdm',
];
}
/**
* Implements hook_file_delete().
*/
function file_mdm_file_delete(EntityInterface $entity) {
// Deletes any cached file metadata information upon deletion of a file
// entity.
$fmdm = \Drupal::service('file_metadata_manager');
$fmdm
->deleteCachedMetadata($entity
->getFileUri());
$fmdm
->release($entity
->getFileUri());
}
Functions
Name | Description |
---|---|
file_mdm_cache_flush | Implements hook_cache_flush(). |
file_mdm_file_delete | Implements hook_file_delete(). |