function LayoutBuilderHooks::entityDelete

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/src/Hook/LayoutBuilderHooks.php \Drupal\layout_builder\Hook\LayoutBuilderHooks::entityDelete()

Implements hook_entity_delete().

Attributes

#[Hook('entity_delete')]

File

core/modules/layout_builder/src/Hook/LayoutBuilderHooks.php, line 214

Class

LayoutBuilderHooks
Hook implementations for layout_builder.

Namespace

Drupal\layout_builder\Hook

Code

public function entityDelete(EntityInterface $entity) : void {
  if (\Drupal::moduleHandler()->moduleExists('block_content')) {
    /** @var \Drupal\layout_builder\InlineBlockEntityOperations $entity_operations */
    $entity_operations = \Drupal::classResolver(InlineBlockEntityOperations::class);
    $entity_operations->handleEntityDelete($entity);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.