function getdirections_get_nid_from_lid in Get Directions 7.2
Same name and namespace in other branches
- 6.2 getdirections.module \getdirections_get_nid_from_lid()
- 7.3 getdirections.module \getdirections_get_nid_from_lid()
1 call to getdirections_get_nid_from_lid()
- theme_getdirections_show in ./
getdirections.module - Theme to use for when one or no locations are supplied.
File
- ./
getdirections.module, line 1479 - Fetches google map directions.
Code
function getdirections_get_nid_from_lid($lid) {
if ($lid) {
$query = FALSE;
if (module_exists('getlocations_fields')) {
$nid = getlocations_get_nid_from_lid($lid);
if ($nid) {
return $nid;
}
}
elseif (module_exists('location')) {
$query = db_select('location_instance', 'i')
->fields('i', array(
'nid',
))
->condition('i.lid', $lid);
}
if ($query) {
$row = $query
->execute()
->fetchAssoc();
return isset($row['nid']) && $row['nid'] ? $row['nid'] : FALSE;
}
}
return FALSE;
}