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. 11.x 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 327

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;
    }
    if (isset($plugin_definition['trackLastImported'])) {
        @trigger_error("The key 'trackLastImported' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3282894", E_USER_DEPRECATED);
    }
    $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'])) {
        @trigger_error("Invalid migration dependencies for {$this->id()} is deprecated in drupal:10.1.0 and will cause an error in drupal:11.0.0. See https://www.drupal.org/node/3266691", E_USER_DEPRECATED);
    }
}

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