You are here

public function TermNode::buildMigrations in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Plugin/migrate/builder/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\builder\d6\TermNode::buildMigrations()

Builds migration entities based on a template.

Parameters

array $template: The parsed template.

Return value

\Drupal\migrate\Entity\MigrationInterface[] The unsaved migrations generated from the template.

Overrides MigrateBuilderInterface::buildMigrations

File

core/modules/taxonomy/src/Plugin/migrate/builder/d6/TermNode.php, line 92
Contains \Drupal\taxonomy\Plugin\migrate\builder\d6\TermNode.

Class

TermNode
Plugin annotation @PluginID("d6_term_node");

Namespace

Drupal\taxonomy\Plugin\migrate\builder\d6

Code

public function buildMigrations(array $template) {
  $migrations = [];
  foreach ($this
    ->getVocabularyIdMap($template['source']) as $source_vid => $destination_vid) {
    $values = $template;
    $values['id'] .= '__' . $source_vid;
    $values['source']['vid'] = $source_vid;
    $migration = Migration::create($values);
    $migration
      ->setProcessOfProperty($destination_vid, 'tid');
    $migrations[] = $migration;
  }
  return $migrations;
}