You are here

public function MigrateDestinationTerm::fields in Migrate 6.2

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

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

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 55
Support for taxonomy term destinations.

Class

MigrateDestinationTerm
Destination class implementing migration into terms.

Code

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

  // First the core (taxonomy_term_data table) properties
  $fields['tid'] = t('Term: <a href="@doc">Existing term ID</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#tid',
  ));
  $fields['name'] = t('Term: <a href="@doc">Name</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#name',
  ));
  $fields['description'] = t('Term: <a href="@doc">Description</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#description',
  ));
  $fields['parent'] = t('Term: <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('Term: <a href="@doc">Parent (by name)</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#parent_name',
  ));
  $fields['format'] = t('Term: <a href="@doc">Format</a>', array(
    '@doc' => 'http://drupal.org/node/1349702#format',
  ));
  $fields['weight'] = t('Term: <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('taxonomy_term', 'fields', $this->entityType, $this->bundle);
  return $fields;
}