You are here

protected static function GroupContentMenuType::clearCacheOnSave in Group Content Menu 8

Clear cache after group menu types are adjusted.

3 calls to GroupContentMenuType::clearCacheOnSave()
GroupContentMenuType::postCreate in src/Entity/GroupContentMenuType.php
Acts on a created entity before hooks are invoked.
GroupContentMenuType::postDelete in src/Entity/GroupContentMenuType.php
Acts on deleted entities before the delete hook is invoked.
GroupContentMenuType::postSave in src/Entity/GroupContentMenuType.php
Acts on a saved entity before the insert or update hook is invoked.

File

src/Entity/GroupContentMenuType.php, line 89

Class

GroupContentMenuType
Defines the Group content menu type configuration entity.

Namespace

Drupal\group_content_menu\Entity

Code

protected static function clearCacheOnSave() {
  \Drupal::service('plugin.manager.group_content_enabler')
    ->clearCachedDefinitions();
  \Drupal::service('router.builder')
    ->rebuild();

  // Invalidate the block cache to update menu-based derivatives.
  \Drupal::service('plugin.manager.block')
    ->clearCachedDefinitions();
}