You are here

public function MigrateDestinationComment::fields in Migrate 7.2

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

Returns a list of fields available to be mapped for comments attached to a particular bundle (node type)

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/comment.inc, line 68
Support for comment destinations.

Class

MigrateDestinationComment
Destination class implementing migration into comments.

Code

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

  // First the core (comment table) properties
  $fields['cid'] = t('<a href="@doc">Existing comment ID</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#cid',
  ));
  $fields['nid'] = t('<a href="@doc">Node (by Drupal ID)</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#nid',
  ));
  $fields['uid'] = t('<a href="@doc">User (by Drupal ID)</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#uid',
  ));
  $fields['pid'] = t('<a href="@doc">Parent (by Drupal ID)</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#pid',
  ));
  $fields['subject'] = t('<a href="@doc">Subject</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#subject',
  ));
  $fields['created'] = t('<a href="@doc">Created timestamp</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#created',
  ));
  $fields['changed'] = t('<a href="@doc">Modified timestamp</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#changed',
  ));
  $fields['status'] = t('<a href="@doc">Status</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#status',
  ));
  $fields['hostname'] = t('<a href="@doc">Hostname/IP address</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#hostname',
  ));
  $fields['name'] = t('<a href="@doc">User name (not username)</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#name',
  ));
  $fields['mail'] = t('<a href="@doc">Email address</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#mail',
  ));
  $fields['homepage'] = t('<a href="@doc">Homepage</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#homepage',
  ));
  $fields['language'] = t('<a href="@doc">Language</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#language',
  ));
  $fields['thread'] = t('<a href="@doc">Thread</a>', array(
    '@doc' => 'http://drupal.org/node/1349714#thread',
  ));

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