public function MigrateDestinationNode::fields in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/destinations/node.inc \MigrateDestinationNode::fields()
Returns a list of fields available to be mapped for the node type (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
1 call to MigrateDestinationNode::fields()
- MigrateDestinationNodeRevision::fields in plugins/
destinations/ node.inc - Returns additional fields on top of node destinations.
1 method overrides MigrateDestinationNode::fields()
- MigrateDestinationNodeRevision::fields in plugins/
destinations/ node.inc - Returns additional fields on top of node destinations.
File
- plugins/
destinations/ node.inc, line 62 - Support for node destinations.
Class
- MigrateDestinationNode
- Destination class implementing migration into nodes.
Code
public function fields($migration = NULL) {
$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['uid'] = t('<a href="@doc">Authored by (uid)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#uid',
));
$fields['created'] = t('<a href="@doc">Created timestamp</a>', array(
'@doc' => 'http://drupal.org/node/1349696#created',
));
$fields['changed'] = t('<a href="@doc">Modified timestamp</a>', array(
'@doc' => 'http://drupal.org/node/1349696#changed',
));
$fields['status'] = t('<a href="@doc">Published</a>', array(
'@doc' => 'http://drupal.org/node/1349696#status',
));
$fields['promote'] = t('<a href="@doc">Promoted to front page</a>', array(
'@doc' => 'http://drupal.org/node/1349696#promote',
));
$fields['sticky'] = t('<a href="@doc">Sticky at top of lists</a>', array(
'@doc' => 'http://drupal.org/node/1349696#sticky',
));
$fields['revision'] = t('<a href="@doc">Create new revision</a>', array(
'@doc' => 'http://drupal.org/node/1349696#revision',
));
$fields['log'] = t('<a href="@doc">Revision Log message</a>', array(
'@doc' => 'http://drupal.org/node/1349696#log',
));
$fields['language'] = t('<a href="@doc">Language (fr, en, ...)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#language',
));
$fields['tnid'] = t('<a href="@doc">The translation set id for this node</a>', array(
'@doc' => 'http://drupal.org/node/1349696#tnid',
));
$fields['translate'] = t('<a href="@doc">A boolean indicating whether this translation page needs to be updated</a>', array(
'@doc' => 'http://drupal.org/node/1349696#translate',
));
$fields['revision_uid'] = t('<a href="@doc">Modified (uid)</a>', array(
'@doc' => 'http://drupal.org/node/1349696#revision_uid',
));
$fields['is_new'] = t('Option: <a href="@doc">Indicates a new node with the specified nid should be created</a>', array(
'@doc' => 'http://drupal.org/node/1349696#is_new',
));
// Then add in anything provided by handlers
$fields += migrate_handler_invoke_all('Entity', 'fields', $this->entityType, $this->bundle, $migration);
$fields += migrate_handler_invoke_all('Node', 'fields', $this->entityType, $this->bundle, $migration);
return $fields;
}