You are here

function getlocations_get_nid in Get Locations 7

Same name and namespace in other branches
  1. 7.2 getlocations.module \getlocations_get_nid()

Function to get the nid from node table.

Parameters

int $vid:

Return value

Returns nid.

2 calls to getlocations_get_nid()
getlocations_other_load_locations in ./getlocations.module
Function to fetch locations. Supports Geofield and Geolocation modules
theme_getlocations_lidinfo in ./getlocations.module
Returns HTML of a url, requested by ajax.

File

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

Code

function getlocations_get_nid($vid) {
  if (is_numeric($vid) && $vid) {
    $query = db_select('node', 'n')
      ->fields('n', array(
      'nid',
    ))
      ->condition('n.vid', $vid);
    $row = $query
      ->execute()
      ->fetchAssoc();
    return isset($row['nid']) && $row['nid'] ? $row['nid'] : FALSE;
  }
  return FALSE;
}