summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/migrate/src/Plugin/MigrationPluginManagerInterface.php
blob: 8d1cb651919ae603798f057ef091ea174dbb98ab (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php

namespace Drupal\migrate\Plugin;

use Drupal\Component\Plugin\PluginManagerInterface;

/**
 * Migration plugin manager interface.
 */
interface MigrationPluginManagerInterface extends PluginManagerInterface {

  /**
   * Create pre-configured instance of plugin derivatives.
   *
   * @param array $id
   *   Either the plugin ID or the base plugin ID of the plugins being
   *   instantiated. Also accepts an array of plugin IDs and an empty array to
   *   load all plugins.
   * @param array $configuration
   *   An array of configuration relevant to the plugin instances. Keyed by the
   *   plugin ID.
   *
   * @return \Drupal\migrate\Plugin\MigrationInterface[]
   *   Fully configured plugin instances.
   *
   * @throws \Drupal\Component\Plugin\Exception\PluginException
   *   If an instance cannot be created, such as if the ID is invalid.
   */
  public function createInstances($id, array $configuration = []);

  /**
   * Expand derivative migration dependencies.
   *
   * @param string[] $migration_ids
   *   A list of plugin IDs.
   *
   * @return array
   *   An array of expanded plugin ids.
   */
  public function expandPluginIds(array $migration_ids);

  /**
   * Creates a stub migration plugin from a definition array.
   *
   * @param array $definition
   *   The migration definition. If an 'id' key is set then this will be used as
   *   the migration ID, if not a random ID will be assigned.
   *
   * @return \Drupal\migrate\Plugin\Migration
   *   The stub migration.
   */
  public function createStubMigration(array $definition);

  /**
   * Create migrations given a tag.
   *
   * @param string $tag
   *   A migration tag we want to filter by.
   *
   * @return array|\Drupal\migrate\Plugin\MigrationInterface[]
   *   An array of migration objects with the given tag, or an empty array if no
   *   migrations with that tag exist.
   */
  public function createInstancesByTag($tag);

}