public function MigrateDestinationNode::fields in Migrate 6.2
Same name and namespace in other branches
- 7.2 plugins/destinations/node.inc \MigrateDestinationNode::fields()
Returns a list of fields available to be mapped for the node type (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/ node.inc, line 56 - Support for node destinations.
Class
- MigrateDestinationNode
- Destination class implementing migration into nodes.
Code
public function fields() {
$fields = array();
// First the core (node table) properties
$fields['nid'] = t('Node: <a href="@doc">Existing node ID</a>', array(
'@doc' => 'http://drupal.org/node/1349696#nid',
));
$node_type = node_type_load($this->bundle);
if ($node_type->has_title) {
$fields['title'] = t('Node: <a href="@doc">', array(
'@doc' => 'http://drupal.org/node/1349696#title',
)) . $node_type->title_label . '</a>';
}
$fields['body'] = t('Node: Body');
$fields['format'] = t('Node: Format');
$fields['teaser'] = t('Node: Teaser');
$fields['uid'] = t('Node: <a href="@doc">Authored by (uid)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#uid',
));
$fields['created'] = t('Node: <a href="@doc">Created timestamp</a>', array(
'@doc' => 'http://drupal.org/node/1349696#created',
));
$fields['changed'] = t('Node: <a href="@doc">Modified timestamp</a>', array(
'@doc' => 'http://drupal.org/node/1349696#changed',
));
$fields['status'] = t('Node: <a href="@doc">Published</a>', array(
'@doc' => 'http://drupal.org/node/1349696#status',
));
$fields['promote'] = t('Node: <a href="@doc">Promoted to front page</a>', array(
'@doc' => 'http://drupal.org/node/1349696#promote',
));
$fields['sticky'] = t('Node: <a href="@doc">Sticky at top of lists</a>', array(
'@doc' => 'http://drupal.org/node/1349696#sticky',
));
$fields['revision'] = t('Node: <a href="@doc">Create new revision</a>', array(
'@doc' => 'http://drupal.org/node/1349696#revision',
));
$fields['log'] = t('Node: <a href="@doc">Revision Log message</a>', array(
'@doc' => 'http://drupal.org/node/1349696#log',
));
$fields['language'] = t('Node: <a href="@doc">Language (fr, en, ...)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#language',
));
$fields['tnid'] = t('Node: <a href="@doc">The translation set id for this node</a>', array(
'@doc' => 'http://drupal.org/node/1349696#tnid',
));
$fields['revision_uid'] = t('Node: <a href="@doc">Modified (uid)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#revision_uid',
));
// Then add in anything provided by handlers
$fields += migrate_handler_invoke_all('Node', 'fields', $this->entityType, $this->bundle);
return $fields;
}