class D6TermNodeDeriver in Drupal 8
Same name and namespace in other branches
- 9 core/modules/taxonomy/src/Plugin/migrate/D6TermNodeDeriver.php \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver
- 10 core/modules/taxonomy/src/Plugin/migrate/D6TermNodeDeriver.php \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver
Deriver for Drupal 6 term node migrations based on vocabularies.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver implements ContainerDeriverInterface uses MigrationDeriverTrait
Expanded class hierarchy of D6TermNodeDeriver
3 string references to 'D6TermNodeDeriver'
- d6_term_node.yml in core/
modules/ taxonomy/ migrations/ d6_term_node.yml - core/modules/taxonomy/migrations/d6_term_node.yml
- d6_term_node_revision.yml in core/
modules/ taxonomy/ migrations/ d6_term_node_revision.yml - core/modules/taxonomy/migrations/d6_term_node_revision.yml
- d6_term_node_translation.yml in core/
modules/ content_translation/ migrations/ d6_term_node_translation.yml - core/modules/content_translation/migrations/d6_term_node_translation.yml
File
- core/
modules/ taxonomy/ src/ Plugin/ migrate/ D6TermNodeDeriver.php, line 14
Namespace
Drupal\taxonomy\Plugin\migrateView source
class D6TermNodeDeriver extends DeriverBase implements ContainerDeriverInterface {
use MigrationDeriverTrait;
/**
* The base plugin ID this derivative is for.
*
* @var string
*/
protected $basePluginId;
/**
* The migration plugin manager.
*
* @var \Drupal\Component\Plugin\PluginManagerInterface
*/
protected $migrationPluginManager;
/**
* D6TermNodeDeriver constructor.
*
* @param string $base_plugin_id
* The base plugin ID this derivative is for.
* @param \Drupal\Component\Plugin\PluginManagerInterface $migration_plugin_manager
* The migration plugin manager.
*/
public function __construct($base_plugin_id, PluginManagerInterface $migration_plugin_manager) {
$this->basePluginId = $base_plugin_id;
$this->migrationPluginManager = $migration_plugin_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($base_plugin_id, $container
->get('plugin.manager.migration'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition, $base_plugin_definitions = NULL) {
try {
foreach (static::getSourcePlugin('d6_taxonomy_vocabulary') as $row) {
$source_vid = $row
->getSourceProperty('vid');
$definition = $base_plugin_definition;
$definition['source']['vid'] = $source_vid;
// migrate_drupal_migration_plugins_alter() adds to this definition.
$this->derivatives[$source_vid] = $definition;
}
} catch (\Exception $e) {
// It is possible no D6 tables are loaded so just eat exceptions.
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
D6TermNodeDeriver:: |
protected | property | The base plugin ID this derivative is for. | |
D6TermNodeDeriver:: |
protected | property | The migration plugin manager. | |
D6TermNodeDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
D6TermNodeDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
D6TermNodeDeriver:: |
public | function | D6TermNodeDeriver constructor. | |
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
MigrationDeriverTrait:: |
public static | function | Returns a fully initialized instance of a source plugin. |