You are here

function hook_ENTITY_TYPE_postdelete in Hook Post Action 8

Gets called after content entity has been deleted from database.

Parameters

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

See also

hook_ENTITY_TYPE_postsave()

hook_ENTITY_TYPE_postinsert()

hook_ENTITY_TYPE_postupdate()

File

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

Code

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