You are here

protected function FeedsAtomRDFProcessor::map in Feeds Atom 7

Same name and namespace in other branches
  1. 6 plugins/FeedsAtomRDFProcessor.inc \FeedsAtomRDFProcessor::map()

Override parent::map() to load all available add-on mappers.

We also add a $source parameter that contains the FeedsSource object that controls this feed.

1 call to FeedsAtomRDFProcessor::map()
FeedsAtomRDFProcessor::process in plugins/FeedsAtomRDFProcessor.inc
Process the result of the parsing stage.

File

plugins/FeedsAtomRDFProcessor.inc, line 159
Contains the feeds atom RDF processor class.

Class

FeedsAtomRDFProcessor
Creates nodes from feed items.

Code

protected function map(FeedsSource $source, FeedsParserResult $result, $target_item = NULL) {
  $fields = field_info_fields();
  foreach ($fields as $field_name => $field_info) {

    // @todo Should check to make sure that no existing mappings are overridden.
    $this->config['mappings'][] = array(
      'source' => $field_name,
      'target' => '__' . $field_name,
      'unique' => 0,
    );
  }
  $target_item = parent::map($source, $result, $target_item);

  // Create a context variable for drupal_alter to use.
  // Use $context instead of passing directly because drupal_alter has a
  // limit on parameters and these should not be altered.
  $context = array(
    'result' => $result,
    'source' => $source,
    'processor' => $this,
  );

  // Allow other modules to add additional mapping.
  drupal_alter('feeds_atom_rdf_map', $target_item, $context);
  return $target_item;
}