You are here

public function ConfigSubscriber::onConfigImport in Group 8

Same name and namespace in other branches
  1. 2.0.x src/EventSubscriber/ConfigSubscriber.php \Drupal\group\EventSubscriber\ConfigSubscriber::onConfigImport()

Causes a group role synchronization after importing config.

Parameters

\Drupal\Core\Config\ConfigImporterEvent $event: The configuration event.

File

src/EventSubscriber/ConfigSubscriber.php, line 49

Class

ConfigSubscriber
Reacts to configuration imports.

Namespace

Drupal\group\EventSubscriber

Code

public function onConfigImport(ConfigImporterEvent $event) {
  $this->pluginManager
    ->installEnforced();

  /** @var \Drupal\group\Entity\Storage\GroupRoleStorageInterface $storage */
  $storage = $this->entityTypeManager
    ->getStorage('group_role');
  $storage
    ->createInternal();
  $storage
    ->createSynchronized();
}