trait MigrationDeriverTrait in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate/src/Plugin/MigrationDeriverTrait.php \Drupal\migrate\Plugin\MigrationDeriverTrait
Provides functionality for migration derivers.
Hierarchy
- trait \Drupal\migrate\Plugin\MigrationDeriverTrait
4 files declare their use of MigrationDeriverTrait
- D6NodeDeriver.php in core/
modules/ node/ src/ Plugin/ migrate/ D6NodeDeriver.php - D6TermNodeDeriver.php in core/
modules/ taxonomy/ src/ Plugin/ migrate/ D6TermNodeDeriver.php - D7NodeDeriver.php in core/
modules/ node/ src/ Plugin/ migrate/ D7NodeDeriver.php - D7TaxonomyTermDeriver.php in core/
modules/ taxonomy/ src/ Plugin/ migrate/ D7TaxonomyTermDeriver.php
File
- core/
modules/ migrate/ src/ Plugin/ MigrationDeriverTrait.php, line 8
Namespace
Drupal\migrate\PluginView source
trait MigrationDeriverTrait {
/**
* Returns a fully initialized instance of a source plugin.
*
* @param string $source_plugin_id
* The source plugin ID.
*
* @return \Drupal\migrate\Plugin\MigrateSourceInterface|\Drupal\migrate\Plugin\RequirementsInterface
* The fully initialized source plugin.
*/
public static function getSourcePlugin($source_plugin_id) {
$definition = [
'source' => [
'ignore_map' => TRUE,
'plugin' => $source_plugin_id,
],
'destination' => [
'plugin' => 'null',
],
'idMap' => [
'plugin' => 'null',
],
];
return \Drupal::service('plugin.manager.migration')
->createStubMigration($definition)
->getSourcePlugin();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrationDeriverTrait:: |
public static | function | Returns a fully initialized instance of a source plugin. |