You are here

public static function GroupContentType::postDelete in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/GroupContentType.php \Drupal\group\Entity\GroupContentType::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 ConfigEntityBundleBase::postDelete

File

src/Entity/GroupContentType.php, line 227

Class

GroupContentType
Defines the Group content type configuration entity.

Namespace

Drupal\group\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {

  // When a GroupContentType is deleted, we clear the views data cache to make
  // sure that all of the views data which relies on group content types is up
  // to date.
  if (\Drupal::moduleHandler()
    ->moduleExists('views')) {
    \Drupal::service('views.views_data')
      ->clear();
  }

  /** @var \Drupal\group\Plugin\Group\Relation\GroupRelationManagerInterface $plugin_manager */
  $plugin_manager = \Drupal::service('plugin.manager.group_relation');

  // We need to reset the plugin ID map cache as it will be out of date now.
  $plugin_manager
    ->clearCachedPluginMaps();
}