You are here

function mobile_number_feeds_processor_targets in Mobile Number 7

Implements hook_feeds_processor_targets().

File

./mobile_number.feeds.inc, line 11
Implementation of Feeds mapping API for mobile_number.module.

Code

function mobile_number_feeds_processor_targets($entity_type, $bundle_name) {
  $targets = array();
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if ($info['type'] == 'mobile_number') {
      $targets[$name . ':value'] = array(
        'name' => t('@label: International Number', array(
          '@label' => $instance['label'],
        )),
        'callback' => 'mobile_number_feeds_set_target',
        'description' => t('International (E.164) number of @label field.', array(
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
      $targets[$name . ':country'] = array(
        'name' => t('@label: Country', array(
          '@label' => $instance['label'],
        )),
        'callback' => 'mobile_number_feeds_set_target',
        'description' => t('Country of @label field.', array(
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
      $targets[$name . ':local_number'] = array(
        'name' => t('@label: Local Number', array(
          '@label' => $instance['label'],
        )),
        'callback' => 'mobile_number_feeds_set_target',
        'description' => t('Local number of @label field.', array(
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
      $targets[$name . ':verified'] = array(
        'name' => t('@label: Verified', array(
          '@label' => $instance['label'],
        )),
        'callback' => 'mobile_number_feeds_set_target',
        'description' => t('Verification status of @label field.', array(
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
      $targets[$name . ':tfa'] = array(
        'name' => t('@label: TFA', array(
          '@label' => $instance['label'],
        )),
        'callback' => 'mobile_number_feeds_set_target',
        'description' => t('TFA status of @label field.', array(
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
    }
  }
  return $targets;
}