You are here

function getlocations_load_locations in Get Locations 7.2

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_load_locations()
  2. 6 getlocations.module \getlocations_load_locations()
  3. 7 getlocations.module \getlocations_load_locations()

Function to fetch locations

Parameters

int $entity_id The entity identifier:

string $entity_type The entity type:

Return value

array $locations

7 calls to getlocations_load_locations()
getlocations_entity_type_map in ./getlocations.module
Page callback: displays a map.
getlocations_fields_views_proximity_get_reference_location in modules/getlocations_fields/views/getlocations_fields.views.inc
Helper function for proximity handlers. Retrieves the coordinates of the location that this field measures distances against.
getlocations_getinfo in ./getlocations.module
getlocations_leaflet_entity_type_map in modules/getlocations_leaflet/getlocations_leaflet.module
getlocations_mapquest_entity_type_map in modules/getlocations_mapquest/getlocations_mapquest.module
Function

... See full list

File

./getlocations.module, line 2766
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_load_locations($entity_id, $entity_type) {
  $locations = '';
  if (module_exists('getlocations_fields')) {
    $locations = getlocations_fields_load_locations($entity_id, $entity_type);
  }
  elseif (module_exists('location_cck')) {
    $entity_get_info = entity_get_info($entity_type);
    $entity_key = $entity_get_info['entity keys']['id'];
    $locations = location_load_locations($entity_id, $entity_key);
  }
  elseif (module_exists('geofield')) {
    $locations = getlocations_other_load_locations($entity_id, $entity_type, 'geofield');
  }
  elseif (module_exists('geolocation')) {
    $locations = getlocations_other_load_locations($entity_id, $entity_type, 'geolocation');
  }
  return $locations;
}