You are here

public function FeedsProcessor::getMappingTargets in Feeds 7.2

Same name and namespace in other branches
  1. 6 plugins/FeedsProcessor.inc \FeedsProcessor::getMappingTargets()
  2. 7 plugins/FeedsProcessor.inc \FeedsProcessor::getMappingTargets()

Declare possible mapping targets that this processor exposes.

Return value

array An array of mapping targets. Keys are paths to targets separated by ->, values are TRUE if target can be unique, FALSE otherwise.

Related topics

4 calls to FeedsProcessor::getMappingTargets()
FeedsNodeProcessor::getMappingTargets in plugins/FeedsNodeProcessor.inc
Return available mapping targets.
FeedsProcessor::getCachedTargets in plugins/FeedsProcessor.inc
Returns a statically cached version of the target mappings.
FeedsTermProcessor::getMappingTargets in plugins/FeedsTermProcessor.inc
Return available mapping targets.
FeedsUserProcessor::getMappingTargets in plugins/FeedsUserProcessor.inc
Return available mapping targets.
3 methods override FeedsProcessor::getMappingTargets()
FeedsNodeProcessor::getMappingTargets in plugins/FeedsNodeProcessor.inc
Return available mapping targets.
FeedsTermProcessor::getMappingTargets in plugins/FeedsTermProcessor.inc
Return available mapping targets.
FeedsUserProcessor::getMappingTargets in plugins/FeedsUserProcessor.inc
Return available mapping targets.

File

plugins/FeedsProcessor.inc, line 1194
Contains FeedsProcessor and related classes.

Class

FeedsProcessor
Abstract class, defines interface for processors.

Code

public function getMappingTargets() {

  // The bundle has not been selected.
  if (!$this
    ->bundle()) {
    $info = $this
      ->entityInfo();
    $bundle_name = !empty($info['bundle name']) ? drupal_strtolower($info['bundle name']) : t('bundle');
    $plugin_key = feeds_importer($this->id)->config['processor']['plugin_key'];
    $url = url('admin/structure/feeds/' . $this->id . '/settings/' . $plugin_key);
    drupal_set_message(t('Please <a href="@url">select a @bundle_name</a>.', array(
      '@url' => $url,
      '@bundle_name' => $bundle_name,
    )), 'warning', FALSE);
  }
  return array(
    'url' => array(
      'name' => t('URL'),
      'description' => t('The external URL of the item. 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 globally unique identifier of the item. E. g. the feed item GUID in the case of a syndication feed. May be unique.'),
      'optional_unique' => TRUE,
    ),
  );
}