You are here

function rolereference_set_target in Role Reference 7

Feeds callback to set mapping target.

1 string reference to 'rolereference_set_target'
rolereference_feeds_processor_targets_alter in ./rolereference.module
Implements feeds_processor_targets_alter().

File

./rolereference.module, line 321

Code

function rolereference_set_target($source, $entity, $target, array $values, $mapping) {

  // Process rolereference field data.
  $info = field_info_field($target);
  if ($info['type'] == 'rolereference') {
    foreach ($values as $rid) {
      if (!empty($rid)) {
        $entity->{$target}[$entity->language][] = array(
          'rid' => $rid,
        );
      }
    }
  }
}