class MigrateSourcePluginManager
Same name and namespace in other branches
- 11.x core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php \Drupal\migrate\Plugin\MigrateSourcePluginManager
Plugin manager for migrate source plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginManagerBase extends \Drupal\Component\Plugin\PluginManagerInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryTrait
- class \Drupal\Core\Plugin\DefaultPluginManager extends \Drupal\Component\Plugin\PluginManagerInterface, \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait, \Drupal\Core\Cache\UseCacheBackendTrait implements \Drupal\Component\Plugin\PluginManagerBase
- class \Drupal\migrate\Plugin\MigratePluginManager extends \Drupal\migrate\Plugin\MigratePluginManagerInterface implements \Drupal\Core\Plugin\DefaultPluginManager
- class \Drupal\migrate\Plugin\MigrateSourcePluginManager implements \Drupal\migrate\Plugin\MigratePluginManager
- class \Drupal\migrate\Plugin\MigratePluginManager extends \Drupal\migrate\Plugin\MigratePluginManagerInterface implements \Drupal\Core\Plugin\DefaultPluginManager
- class \Drupal\Core\Plugin\DefaultPluginManager extends \Drupal\Component\Plugin\PluginManagerInterface, \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait, \Drupal\Core\Cache\UseCacheBackendTrait implements \Drupal\Component\Plugin\PluginManagerBase
Expanded class hierarchy of MigrateSourcePluginManager
See also
\Drupal\migrate\Plugin\MigrateSourceInterface
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
\Drupal\migrate\Annotation\MigrateSource
Related topics
1 file declares its use of MigrateSourcePluginManager
- MigrationPluginManager.php in core/
modules/ migrate_drupal/ src/ MigrationPluginManager.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);
});
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.