You are here

public function MigrateDestinationTerm::fields in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/destinations/term.inc \MigrateDestinationTerm::fields()

Returns a list of fields available to be mapped for this vocabulary (bundle)

Parameters

Migration $migration: Optionally, the migration containing this destination.

Return value

array Keys: machine names of the fields (to be passed to addFieldMapping) Values: Human-friendly descriptions of the fields.

Overrides MigrateDestination::fields

File

plugins/destinations/term.inc, line 73
Support for taxonomy term destinations.

Class

MigrateDestinationTerm
Destination class implementing migration into terms.

Code

public function fields($migration = NULL) {
  $fields = array();

  // First the core (taxonomy_term_data table) properties
  $fields['tid'] = t('<a href="@doc">Existing term ID</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#tid',
  ));
  $fields['name'] = t('<a href="@doc">Name</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#name',
  ));
  $fields['description'] = t('<a href="@doc">Description</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#description',
  ));
  $fields['parent'] = t('<a href="@doc">Parent (by Drupal term ID)</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#parent',
  ));

  // TODO: Remove parent_name, implement via arguments
  $fields['parent_name'] = t('<a href="@doc">Parent (by name)</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#parent_name',
  ));
  $fields['format'] = t('<a href="@doc">Format</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#format',
  ));
  $fields['weight'] = t('<a href="@doc">Weight</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#weight',
  ));

  // Then add in anything provided by handlers
  $fields += migrate_handler_invoke_all('entity', 'fields', $this->entityType, $this->bundle, $migration);
  $fields += migrate_handler_invoke_all('taxonomy_term', 'fields', $this->entityType, $this->bundle, $migration);
  return $fields;
}