You are here

public function ScheduledTransitionsEntityHooks::entityDelete in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x src/ScheduledTransitionsEntityHooks.php \Drupal\scheduled_transitions\ScheduledTransitionsEntityHooks::entityDelete()

Implements hook_entity_delete().

See also

\scheduled_transitions_entity_delete()

File

src/ScheduledTransitionsEntityHooks.php, line 120

Class

ScheduledTransitionsEntityHooks
Entity related hooks for Scheduled Transitions module.

Namespace

Drupal\scheduled_transitions

Code

public function entityDelete(EntityInterface $entity) : void {
  $transitionStorage = $this->entityTypeManager
    ->getStorage('scheduled_transition');
  $transitionsForEntity = $this
    ->loadByHostEntity($entity);
  $transitionStorage
    ->delete($transitionsForEntity);
}