You are here

function number_feeds_processor_targets_alter in Feeds 8.2

Implements hook_feeds_processor_targets_alter().

See also

FeedsProcessor::getMappingTargets()

File

mappers/number.inc, line 13
On behalf implementation of Feeds mapping API for number.module.

Code

function number_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  $numeric_types = array(
    'list_integer',
    'list_float',
    'list_boolean',
    'number_integer',
    'number_decimal',
    'number_float',
  );
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if (in_array($info['type'], $numeric_types)) {
      $targets[$name] = array(
        'name' => check_plain($instance['label']),
        'callback' => 'number_feeds_set_target',
        'description' => t('The @label field of the entity.', array(
          '@label' => $instance['label'],
        )),
      );
    }
  }
}