You are here

protected function PluginManager::configurePlugin in Backup and Migrate 5.0.x

Set the configuration for the given plugin.

Parameters

$plugin:

$id:

2 calls to PluginManager::configurePlugin()
PluginManager::preparePlugin in src/Core/Plugin/PluginManager.php
Prepare the plugin for use.
PluginManager::setConfig in src/Core/Plugin/PluginManager.php
Set the configuration. Reconfigure all of the installed plugins.

File

src/Core/Plugin/PluginManager.php, line 162

Class

PluginManager
@package Drupal\backup_migrate\Core\Plugin

Namespace

Drupal\backup_migrate\Core\Plugin

Code

protected function configurePlugin(PluginInterface $plugin, $id) {

  // If this plugin can be configured, then pass in the configuration.
  if ($plugin instanceof ConfigurableInterface) {

    // Configure the plugin with the appropriate subset of the configuration.
    $config = (array) $this
      ->confGet($id);

    // Set the config for the plugin.
    $plugin
      ->setConfig(new Config($config));

    // Get the configuration back from the plugin to populate defaults within
    // the manager.
    $this
      ->config()
      ->set($id, $plugin
      ->config());
  }
}