function MigratePluginManager::__construct

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

Constructs a MigratePluginManager object.

Parameters

string $type: The type of the plugin: row, source, process, destination, entity_field, id_map.

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.

string $attribute: (optional) The attribute class name. Defaults to 'Drupal\Component\Plugin\Attribute\PluginID'.

string $annotation: (optional) The annotation class name. Defaults to 'Drupal\Component\Annotation\PluginID'.

Overrides DefaultPluginManager::__construct

3 calls to MigratePluginManager::__construct()
MigrateDestinationPluginManager::__construct in core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php
Constructs a MigrateDestinationPluginManager object.
MigrateFieldPluginManagerTestClass::__construct in core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
Constructs a MigratePluginManagerTestClass object.
MigrateSourcePluginManager::__construct in core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php
MigrateSourcePluginManager constructor.
3 methods override MigratePluginManager::__construct()
MigrateDestinationPluginManager::__construct in core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php
Constructs a MigrateDestinationPluginManager object.
MigrateFieldPluginManagerTestClass::__construct in core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
Constructs a MigratePluginManagerTestClass object.
MigrateSourcePluginManager::__construct in core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php
MigrateSourcePluginManager constructor.

File

core/modules/migrate/src/Plugin/MigratePluginManager.php, line 48

Class

MigratePluginManager
Manages migrate plugins.

Namespace

Drupal\migrate\Plugin

Code

public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, $attribute = PluginID::class, $annotation = 'Drupal\\Component\\Annotation\\PluginID') {
    if (!is_subclass_of($attribute, AttributeInterface::class)) {
        // Backward compatibility.
        $annotation = $attribute;
        $attribute = PluginID::class;
    }
    parent::__construct("Plugin/migrate/{$type}", $namespaces, $module_handler, NULL, $attribute, $annotation);
    $this->alterInfo('migrate_' . $type . '_info');
    $this->setCacheBackend($cache_backend, 'migrate_plugins_' . $type);
}

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