function getlocations_get_nid_from_lid in Get Locations 7.2
Same name and namespace in other branches
- 6.2 getlocations.module \getlocations_get_nid_from_lid()
- 6 getlocations.module \getlocations_get_nid_from_lid()
- 7 getlocations.module \getlocations_get_nid_from_lid()
Function to get nid from location_instance table.
Parameters
int $lid:
Return value
Returns nid.
1 call to getlocations_get_nid_from_lid()
File
- ./
getlocations.module, line 1429 - getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_get_nid_from_lid($lid) {
if (is_numeric($lid) && $lid) {
if (module_exists('location') && (module_exists('location_cck') || module_exists('location_node'))) {
$query = db_select('location_instance', 'i')
->fields('i', array(
'nid',
))
->condition('i.lid', $lid);
$row = $query
->execute()
->fetchAssoc();
return isset($row['nid']) && $row['nid'] ? $row['nid'] : FALSE;
}
}
return FALSE;
}