Same name and namespace in other branches
- 8.9.x core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php \Drupal\migrate\Plugin\MigrateSourcePluginManager
- 9 core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php \Drupal\migrate\Plugin\MigrateSourcePluginManager
Plugin manager for migrate source plugins.
Hierarchy
- class \Drupal\migrate\Plugin\MigratePluginManager extends \Drupal\Core\Plugin\DefaultPluginManager implements MigratePluginManagerInterface
- class \Drupal\migrate\Plugin\MigrateSourcePluginManager
Expanded class hierarchy of MigrateSourcePluginManager
See also
\Drupal\migrate\Plugin\MigrateSourceInterface
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
\Drupal\migrate\Annotation\MigrateSource
Related topics
2 files declare their use of MigrateSourcePluginManager
- MigrationPluginManager.php in core/
modules/ migrate_drupal/ src/ MigrationPluginManager.php - MigrationTest.php in core/
modules/ migrate/ tests/ src/ Unit/ MigrationTest.php
1 string reference to 'MigrateSourcePluginManager'
- migrate.services.yml in core/
modules/ migrate/ migrate.services.yml - core/modules/migrate/migrate.services.yml
1 service uses MigrateSourcePluginManager
- plugin.manager.migrate.source in core/
modules/ migrate/ migrate.services.yml - Drupal\migrate\Plugin\MigrateSourcePluginManager
File
- core/
modules/ migrate/ src/ Plugin/ MigrateSourcePluginManager.php, line 21
Namespace
Drupal\migrate\PluginView source
class MigrateSourcePluginManager extends MigratePluginManager {
/**
* MigrateSourcePluginManager constructor.
*
* @param string $type
* The type of the plugin: row, source, process, destination, entity_field,
* id_map.
* @param \Traversable $namespaces
* An object that implements \Traversable which contains the root paths
* keyed by the corresponding namespace to look for plugin implementations.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* Cache backend instance to use.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to invoke the alter hook with.
*/
public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct($type, $namespaces, $cache_backend, $module_handler, 'Drupal\\migrate\\Annotation\\MigrateSource');
}
/**
* {@inheritdoc}
*/
protected function getDiscovery() {
if (!$this->discovery) {
$discovery = new AnnotatedClassDiscoveryAutomatedProviders($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces);
$this->discovery = new ContainerDerivativeDiscoveryDecorator($discovery);
}
return $this->discovery;
}
/**
* Finds plugin definitions.
*
* @return array
* List of definitions to store in cache.
*
* @todo This is a temporary solution to the fact that migration source
* plugins have more than one provider. This functionality will be moved to
* core in https://www.drupal.org/node/2786355.
*/
protected function findDefinitions() {
$definitions = $this
->getDiscovery()
->getDefinitions();
foreach ($definitions as $plugin_id => &$definition) {
$this
->processDefinition($definition, $plugin_id);
}
$this
->alterDefinitions($definitions);
return ProviderFilterDecorator::filterDefinitions($definitions, function ($provider) {
return $this
->providerExists($provider);
});
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DiscoveryInterface:: |
public | function | Gets a specific plugin definition. | 2 |
DiscoveryInterface:: |
public | function | Gets the definition of all plugins for this type. | 3 |
DiscoveryInterface:: |
public | function | Indicates if a specific plugin definition exists. | |
MapperInterface:: |
public | function | Gets or creates a plugin instance that satisfies the given options. | 2 |
MigratePluginManager:: |
public | function |
Creates a pre-configured instance of a migration plugin. Overrides MigratePluginManagerInterface:: |
1 |
MigrateSourcePluginManager:: |
protected | function | Finds plugin definitions. | |
MigrateSourcePluginManager:: |
protected | function | ||
MigrateSourcePluginManager:: |
public | function |
MigrateSourcePluginManager constructor. Overrides MigratePluginManager:: |