You are here

public function D6TermNodeDeriver::getDerivativeDefinitions in Drupal 9

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

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

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