You are here

function getdirections_get_vid in Get Directions 7.3

Same name and namespace in other branches
  1. 6.2 getdirections.module \getdirections_get_vid()
  2. 7.2 getdirections.module \getdirections_get_vid()

File

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

Code

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