function search_file_attachments_file_predelete in Search File Attachments 8
Implements hook_ENTITY_TYPE_predelete() for file entities.
Parameters
\Drupal\Core\Entity\EntityInterface $entity:
File
- ./
search_file_attachments.module, line 8
Code
function search_file_attachments_file_predelete(Drupal\Core\Entity\EntityInterface $entity) {
// Ensure that all files deleted are removed from the search index.
search_index_clear('file_search', $entity
->id());
}