You are here

function build_hooks_entity_delete in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x build_hooks.module \build_hooks_entity_delete()

Implements hook_entity_delete().

File

./build_hooks.module, line 68
Contains build_hooks.module.

Code

function build_hooks_entity_delete(EntityInterface $entity) {
  if ($entity instanceof ContentEntityInterface) {
    if (build_hooks_get_logger_service()
      ->isEntityTypeLoggable($entity)) {
      $triggerService = build_hooks_get_trigger_service();
      build_hooks_get_logger_service()
        ->logEntityDeleted($entity);
      $triggerService
        ->deployFrontendEntityUpdateEnvironments();
      $triggerService
        ->invalidateToolbarCacheTag();
    }
  }
}