You are here

public function FeedsParser::getMappingSources in Feeds 6

Same name and namespace in other branches
  1. 7.2 plugins/FeedsParser.inc \FeedsParser::getMappingSources()
  2. 7 plugins/FeedsParser.inc \FeedsParser::getMappingSources()

Declare the possible mapping sources that this parser produces.

Return value

An array of mapping sources, or FALSE if the sources can be defined by typing a value in a text field.

Example:

array(
  'title' => t('Title'),
  'created' => t('Published date'),
  'url' => t('Feed item URL'),
  'guid' => t('Feed item GUID'),
);

Related topics

4 calls to FeedsParser::getMappingSources()
FeedsOPMLParser::getMappingSources in plugins/FeedsOPMLParser.inc
Return mapping sources.
FeedsSimplePieParser::getMappingSources in plugins/FeedsSimplePieParser.inc
Return mapping sources.
FeedsSitemapParser::getMappingSources in plugins/FeedsSitemapParser.inc
Implementation of FeedsParser::getMappingSources().
FeedsSyndicationParser::getMappingSources in plugins/FeedsSyndicationParser.inc
Return mapping sources.
5 methods override FeedsParser::getMappingSources()
FeedsCSVParser::getMappingSources in plugins/FeedsCSVParser.inc
Override parent::getMappingSources().
FeedsOPMLParser::getMappingSources in plugins/FeedsOPMLParser.inc
Return mapping sources.
FeedsSimplePieParser::getMappingSources in plugins/FeedsSimplePieParser.inc
Return mapping sources.
FeedsSitemapParser::getMappingSources in plugins/FeedsSitemapParser.inc
Implementation of FeedsParser::getMappingSources().
FeedsSyndicationParser::getMappingSources in plugins/FeedsSyndicationParser.inc
Return mapping sources.

File

plugins/FeedsParser.inc, line 48

Class

FeedsParser
Abstract class, defines interface for parsers.

Code

public function getMappingSources() {
  self::loadMappers();
  $sources = array();
  drupal_alter('feeds_parser_sources', $sources, feeds_importer($this->id)->config['content_type']);
  if (!feeds_importer($this->id)->config['content_type']) {
    return $sources;
  }
  $sources['parent:uid'] = array(
    'name' => t('Feed node: User ID'),
    'description' => t('The feed node author uid.'),
  );
  $sources['parent:nid'] = array(
    'name' => t('Feed node: Node ID'),
    'description' => t('The feed node nid.'),
  );
  return $sources;
}