my_module_set_target

7 feeds.api.php my_module_set_target($source, $entity, $target, $value, $mapping)

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'

File

contributions/feeds/feeds.api.php, line 250
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'];
  }
}