You are here

function hook_entity_postdelete in Hook Post Action 8

Same name and namespace in other branches
  1. 7 hook_post_action.api.php \hook_entity_postdelete()

Gets called after an entity has been deleted from database.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity object.

See also

hook_entity_postsave()

hook_entity_postinsert()

hook_entity_postupdate()

File

./hook_post_action.api.php, line 97
Documents API functions for hook_post_action module.

Code

function hook_entity_postdelete(EntityInterface $entity) {
  $id = $entity
    ->id();
  $entity_type = $entity
    ->getEntityTypeId();
  \Drupal::logger('hook_post_action_test')
    ->info('The deleted entity @entity_type id is @id from @function.', [
    '@id' => $id,
    '@function' => __FUNCTION__,
    '@entity_type' => $entity_type,
  ]);
}