You are here

function name_feeds_processor_targets_alter in Name Field 7

Implements hook_feeds_processor_targets_alter().

File

./name.feeds.inc, line 11
Implements Feeds mapping API.

Code

function name_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if ($info['type'] == 'name') {
      foreach (_name_translations() as $key => $title) {
        if (array_key_exists($key, $info['columns'])) {
          $targets[$name . ':' . $key] = array(
            'name' => t('@name !component', array(
              '@name' => $instance['label'],
              '!component' => $title,
            )),
            'callback' => 'name_feeds_set_target',
            'description' => t('The !component component of the @label field of the node.', array(
              '@label' => $instance['label'],
              '!component' => $title,
            )),
          );
        }
      }
    }
  }
}