forked from mortenson/geocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeocoder.api.php
More file actions
23 lines (21 loc) · 797 Bytes
/
geocoder.api.php
File metadata and controls
23 lines (21 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
* Implements hook_entity_property_info_alter().
*
* Give Users a virtual property that contains all relevant address information from multiple sources.
*/
function YOURMOD_entity_property_info_alter(&$info) {
$info['user']['bundles']['user']['properties']['full_address'] = array(
'type' => 'text',
'label' => 'Full adress (from other fields)',
'getter callback' => 'YOURMOD_user_full_address',
);
}
/**
* Entity property callback for user.full_address.
*
* field_address is a text field, and when combined with a variable makes the full address.
*/
function YOURMOD_user_full_address($entity, $options, $field, $entity_type, $property) {
return $entity->field_address[LANGUAGE_NONE][0]['value'] . ', ' . variable_get('YOURMOD_global_country', 'Zimbabwe');
}