You are here

function hook_entity_revision_delete in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_revision_delete()

Respond to entity revision deletion.

This hook runs once the entity revision has been deleted from the storage.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity object for the entity revision that has been deleted.

See also

hook_ENTITY_TYPE_revision_delete()

Related topics

2 functions implement hook_entity_revision_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

content_moderation_entity_revision_delete in core/modules/content_moderation/content_moderation.module
Implements hook_entity_revision_delete().
editor_entity_revision_delete in core/modules/editor/editor.module
Implements hook_entity_revision_delete().
1 invocation of hook_entity_revision_delete()
ContentEntityStorageBase::deleteRevision in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Delete a specific entity revision.

File

core/lib/Drupal/Core/Entity/entity.api.php, line 1436
Hooks and documentation related to entities.

Code

function hook_entity_revision_delete(\Drupal\Core\Entity\EntityInterface $entity) {
  $referenced_files_by_field = _editor_get_file_uuids_by_field($entity);
  foreach ($referenced_files_by_field as $field => $uuids) {
    _editor_delete_file_usage($uuids, $entity, 1);
  }
}