You are here

function build_hooks_entity_update in Build Hooks 8.2

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

Implements hook_entity_update().

File

./build_hooks.module, line 40
Contains build_hooks.module.

Code

function build_hooks_entity_update(EntityInterface $entity) {
  if ($entity instanceof ContentEntityInterface) {
    if (!$entity
      ->isNew() && build_hooks_get_logger_service()
      ->isEntityTypeLoggable($entity)) {
      $triggerService = build_hooks_get_trigger_service();
      build_hooks_get_logger_service()
        ->logEntityUpdated($entity);
      $triggerService
        ->deployFrontendEntityUpdateEnvironments();
      $triggerService
        ->invalidateToolbarCacheTag();
    }
  }
}