You are here

function domain_access_domain_delete in Domain Access 8

Implements hook_ENTITY_TYPE_delete().

File

domain_access/domain_access.module, line 711
Domain-based access control for content.

Code

function domain_access_domain_delete(EntityInterface $entity) {
  $controller = \Drupal::entityTypeManager()
    ->getStorage('action');
  $actions = $controller
    ->loadMultiple([
    'domain_access_add_action.' . $entity
      ->id(),
    'domain_access_remove_action.' . $entity
      ->id(),
    'domain_access_add_editor_action.' . $entity
      ->id(),
    'domain_access_remove_editor_action.' . $entity
      ->id(),
  ]);
  foreach ($actions as $action) {
    $action
      ->delete();
  }
}