You are here

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

Prepare the plugin for use.

This is called when a plugin is added to the manager and it configures the plugin according to the config object injected into the manager. It also injects other dependencies as needed.

Parameters

\Drupal\backup_migrate\Core\Plugin\PluginInterface $plugin: The plugin to prepare for use.

string $id: The id of the plugin (to extract the correct settings).

1 call to PluginManager::preparePlugin()
PluginManager::add in src/Core/Plugin/PluginManager.php
Add an item to the manager.

File

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

Class

PluginManager
@package Drupal\backup_migrate\Core\Plugin

Namespace

Drupal\backup_migrate\Core\Plugin

Code

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

  // If this plugin can be configured, then pass in the configuration.
  $this
    ->configurePlugin($plugin, $id);

  // Inject the available services.
  $this
    ->services()
    ->addClient($plugin);
}