summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/migrate/src/Plugin/MigratePluginManagerInterface.php
blob: 2d21fc34ab6c5fc54e2e891830c52adccd264f96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Drupal\migrate\Plugin;

use Drupal\Component\Plugin\PluginManagerInterface;

/**
 * Interface for the migration plugin manager.
 */
interface MigratePluginManagerInterface extends PluginManagerInterface {

  /**
   * Creates a pre-configured instance of a migration plugin.
   *
   * A specific createInstance method is necessary to pass the migration on.
   *
   * @param string $plugin_id
   *   The ID of the plugin being instantiated.
   * @param array $configuration
   *   An array of configuration relevant to the plugin instance.
   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   *   The migration context in which the plugin will run.
   *
   * @return object
   *   A fully configured plugin instance.
   *
   * @throws \Drupal\Component\Plugin\Exception\PluginException
   *   If the instance cannot be created, such as if the ID is invalid.
   */
  public function createInstance($plugin_id, array $configuration = [], ?MigrationInterface $migration = NULL);

}