You are here

function entity_hierarchy_entity_delete in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x entity_hierarchy.module \entity_hierarchy_entity_delete()

Implements hook_entity_delete().

File

./entity_hierarchy.module, line 81
A module to make entities hierarchical.

Code

function entity_hierarchy_entity_delete(EntityInterface $entity) {
  if (!$entity instanceof ContentEntityInterface) {
    return;
  }
  \Drupal::service('class_resolver')
    ->getInstanceFromDefinition(ParentEntityDeleteUpdater::class)
    ->moveChildren($entity);
}