function Migration::__construct

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::__construct()
  2. 8.9.x core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::__construct()
  3. 10 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::__construct()

Constructs a Migration.

Parameters

array $configuration: Plugin configuration.

string $plugin_id: The plugin ID.

mixed $plugin_definition: The plugin definition.

\Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager: The migration plugin manager.

\Drupal\migrate\Plugin\MigratePluginManagerInterface $source_plugin_manager: The source migration plugin manager.

\Drupal\migrate\Plugin\MigratePluginManagerInterface $process_plugin_manager: The process migration plugin manager.

\Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager: The destination migration plugin manager.

\Drupal\migrate\Plugin\MigratePluginManagerInterface $id_map_plugin_manager: The ID map migration plugin manager.

1 call to Migration::__construct()
FieldMigration::__construct in core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php
Constructs a FieldMigration.
3 methods override Migration::__construct()
FieldMigration::__construct in core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php
Constructs a FieldMigration.
TestMigration::__construct in core/modules/migrate/tests/src/Unit/MigrationTest.php
Constructs an instance of TestMigration object.
TestMigrationMock::__construct in core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
TestMigrationMock constructor.

File

core/modules/migrate/src/Plugin/Migration.php, line 315

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManagerInterface $source_plugin_manager, MigratePluginManagerInterface $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManagerInterface $id_map_plugin_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->migrationPluginManager = $migration_plugin_manager;
    $this->sourcePluginManager = $source_plugin_manager;
    $this->processPluginManager = $process_plugin_manager;
    $this->destinationPluginManager = $destination_plugin_manager;
    $this->idMapPluginManager = $id_map_plugin_manager;
    foreach (NestedArray::mergeDeepArray([
        $plugin_definition,
        $configuration,
    ], TRUE) as $key => $value) {
        $this->{$key} = $value;
    }
    $this->migration_dependencies = ($this->migration_dependencies ?: []) + [
        'required' => [],
        'optional' => [],
    ];
    if (count($this->migration_dependencies) !== 2 || !is_array($this->migration_dependencies['required']) || !is_array($this->migration_dependencies['optional'])) {
        throw new InvalidPluginDefinitionException($this->id(), "Invalid migration dependencies configuration for migration {$this->id()}");
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.