You are here

public function D6TermNodeDeriver::getDerivativeDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Plugin/migrate/D6TermNodeDeriver.php \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver::getDerivativeDefinitions()
  2. 9 core/modules/taxonomy/src/Plugin/migrate/D6TermNodeDeriver.php \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver::getDerivativeDefinitions()

File

core/modules/taxonomy/src/Plugin/migrate/D6TermNodeDeriver.php, line 57

Class

D6TermNodeDeriver
Deriver for Drupal 6 term node migrations based on vocabularies.

Namespace

Drupal\taxonomy\Plugin\migrate

Code

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;
}