function getdirections_get_vid in Get Directions 7.2
Same name and namespace in other branches
- 6.2 getdirections.module \getdirections_get_vid()
 - 7.3 getdirections.module \getdirections_get_vid()
 
Function to get the vid from node table.
Parameters
int $nid:
Return value
Returns vid.
5 calls to getdirections_get_vid()
- getdirections_n2u_setlocation in ./
getdirections.module  - Function to setup the map
 - getdirections_setlocation in ./
getdirections.module  - Function to setup the map and form
 - getdirections_setlocations in ./
getdirections.module  - Function to setup the map
 - getdirections_setlocations_via in ./
getdirections.module  - Function to setup the map to display waypoints
 - getdirections_u2n_setlocation in ./
getdirections.module  - Function to setup the map and form
 
File
- ./
getdirections.module, line 1461  - 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;
}