public function FeedsUcAddressesProcessor::getMappingTargets in Ubercart Addresses 7
Return available mapping targets.
File
- feeds/
FeedsUcAddressesProcessor.inc, line 169 - Contains the FeedsUcAddressesProcessor class.
Class
- FeedsUcAddressesProcessor
- A processor for importing data belonging to an Ubercart Addresses address.
Code
public function getMappingTargets() {
$targets = parent::getMappingTargets();
$address = UcAddressesAddress::newAddress();
$fields = uc_addresses_get_address_field_handler_instances($address, 'feeds');
foreach ($fields as $fieldname => $handler) {
$targets = array_merge($targets, $handler
->getMappingTargets());
}
// Extra targets for user.
$targets['user_name'] = array(
'name' => t('Username'),
'description' => t('The Drupal username of the address owner.'),
);
$targets['user_mail'] = array(
'name' => t('User email'),
'description' => t('The email address of the address owner.'),
);
// Set unique targets.
$targets['aid']['optional_unique'] = TRUE;
// Allow other modules to modify targets.
if (method_exists($this, 'getHookTargets')) {
$this
->getHookTargets($targets);
}
return $targets;
}