You are here

function getdirections_get_nid in Get Directions 7.3

Same name and namespace in other branches
  1. 7.2 getdirections.module \getdirections_get_nid()

File

./getdirections.module, line 1484
Fetches google map directions.

Code

function getdirections_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;
}