You are here

public static function RngEventType::postDelete in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 3.x src/Entity/RngEventType.php \Drupal\rng\Entity\RngEventType::postDelete()

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityBase::postDelete

File

src/Entity/RngEventType.php, line 490

Class

RngEventType
Defines the event type entity.

Namespace

Drupal\rng\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
  parent::postDelete($storage, $entities);
  if ($event_type = reset($entities)) {
    RngEventType::courierContextCC($event_type->entity_type, 'delete');
  }

  // Rebuild routes and local tasks.
  \Drupal::service('router.builder')
    ->setRebuildNeeded();

  // Rebuild local actions https://github.com/dpi/rng/issues/18
  \Drupal::service('plugin.manager.menu.local_action')
    ->clearCachedDefinitions();
}