You are here

function my_module_set_target in Feeds 8.2

Same name and namespace in other branches
  1. 7 feeds.api.php \my_module_set_target()

Example callback specified in hook_feeds_processor_targets_alter().

Parameters

$source: Field mapper source settings.

$entity: An entity object, for instance a node object.

$target: A string identifying the target on the node.

$value: The value to populate the target with.

$mapping: Associative array of the mapping settings from the per mapping configuration form.

Related topics

1 string reference to 'my_module_set_target'
hook_feeds_processor_targets_alter in ./feeds.api.php
Alter mapping targets for entities. Use this hook to add additional target options to the mapping form of Node processors.

File

./feeds.api.php, line 306
Documentation of Feeds hooks.

Code

function my_module_set_target($source, $entity, $target, $value, $mapping) {
  $entity->{$target}[$entity->language][0]['value'] = $value;
  if (isset($source->importer->processor->config['input_format'])) {
    $entity->{$target}[$entity->language][0]['format'] = $source->importer->processor->config['input_format'];
  }
}