function addressfield_phone_feeds_processor_targets_alter in Address Field Phone 7
Implements hook_feeds_processor_targets_alter().
See also
FeedsNodeProcessor::getMappingTargets().
File
- ./
addressfield_phone.feeds.inc, line 12 - Feeds integration for Addressfield Phone module.
Code
function addressfield_phone_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'] == 'addressfield') {
$targets[$name . ':phone_number'] = array(
'name' => $instance['label'] . ': Phone',
'callback' => 'addressfield_phone_feeds_set_target',
'description' => t('The Phone field of the address.'),
);
$targets[$name . ':phone_number_extension'] = array(
'name' => $instance['label'] . ': Phone Extension',
'callback' => 'addressfield_phone_feeds_set_target',
'description' => t('The Phone Extension field of the address.'),
);
$targets[$name . ':mobile_number'] = array(
'name' => $instance['label'] . ': Mobile Number',
'callback' => 'addressfield_phone_feeds_set_target',
'description' => t('The Mobile Number field of the address.'),
);
$targets[$name . ':fax_number'] = array(
'name' => $instance['label'] . ': Fax Number',
'callback' => 'addressfield_phone_feeds_set_target',
'description' => t('The Fax Number field of the address.'),
);
}
}
}