function weight_feeds_set_target in Weight 7.2
Callback for mapping weights.
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.
1 string reference to 'weight_feeds_set_target'
File
- ./
weight.module, line 508
Code
function weight_feeds_set_target($source, $entity, $target, $values) {
if (!is_array($values)) {
$values = array(
$values,
);
}
$weight = NULL;
foreach ($values as $value) {
if (is_numeric($value)) {
$weight = $value;
break;
}
}
$entity->weight_weight = $weight;
}