You are here

protected function UserProtectionPluginCollection::initializePlugin in User protect 8

Initializes and stores a plugin.

Parameters

string $instance_id: The ID of the plugin instance to initialize.

Overrides DefaultLazyPluginCollection::initializePlugin

1 call to UserProtectionPluginCollection::initializePlugin()
UserProtectionPluginCollection::getAll in src/Plugin/UserProtection/UserProtectionPluginCollection.php
Retrieves all user protection plugin instances.

File

src/Plugin/UserProtection/UserProtectionPluginCollection.php, line 69

Class

UserProtectionPluginCollection
A collection of protection rules.

Namespace

Drupal\userprotect\Plugin\UserProtection

Code

protected function initializePlugin($instance_id) {
  $configuration = $this->manager
    ->getDefinition($instance_id);

  // Merge the actual configuration into the default configuration.
  if (isset($this->configurations[$instance_id])) {
    $configuration = NestedArray::mergeDeep($configuration, $this->configurations[$instance_id]);
  }
  $this->configurations[$instance_id] = $configuration;
  parent::initializePlugin($instance_id);
}