public function FeedsNodeProcessor::getMappingTargets in Feeds 7
Same name and namespace in other branches
- 6 plugins/FeedsNodeProcessor.inc \FeedsNodeProcessor::getMappingTargets()
- 7.2 plugins/FeedsNodeProcessor.inc \FeedsNodeProcessor::getMappingTargets()
Return available mapping targets.
Overrides FeedsProcessor::getMappingTargets
File
- plugins/
FeedsNodeProcessor.inc, line 256 - Class definition of FeedsNodeProcessor.
Class
- FeedsNodeProcessor
- Creates nodes from feed items.
Code
public function getMappingTargets() {
$type = node_type_get_type($this->config['content_type']);
$targets = array();
if ($type->has_title) {
$targets['title'] = array(
'name' => t('Title'),
'description' => t('The title of the node.'),
);
}
$targets += array(
'nid' => array(
'name' => t('Node ID'),
'description' => t('The nid of the node. NOTE: use this feature with care, node ids are usually assigned by Drupal.'),
'optional_unique' => TRUE,
),
'uid' => array(
'name' => t('User ID'),
'description' => t('The Drupal user ID of the node author.'),
),
'status' => array(
'name' => t('Published status'),
'description' => t('Whether a node is published or not. 1 stands for published, 0 for not published.'),
),
'created' => array(
'name' => t('Published date'),
'description' => t('The UNIX time when a node has been published.'),
),
'url' => array(
'name' => t('URL'),
'description' => t('The external URL of the node. E. g. the feed item URL in the case of a syndication feed. May be unique.'),
'optional_unique' => TRUE,
),
'guid' => array(
'name' => t('GUID'),
'description' => t('The external GUID of the node. E. g. the feed item GUID in the case of a syndication feed. May be unique.'),
'optional_unique' => TRUE,
),
);
// Let other modules expose mapping targets.
self::loadMappers();
feeds_alter('feeds_processor_targets', $targets, 'node', $this->config['content_type']);
return $targets;
}