You are here

function getlocations_type_load in Get Locations 7

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_type_load()
  2. 6 getlocations.module \getlocations_type_load()
  3. 7.2 getlocations.module \getlocations_type_load()

Check that the node type exists

Parameters

string $arg Node type.:

Return value

argument or FALSE

File

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

Code

function getlocations_type_load($arg) {
  $query = db_select('node_type', 'n')
    ->fields('n', array(
    'type',
  ))
    ->condition('n.type', $arg);
  $row = $query
    ->execute()
    ->fetchAssoc();
  return isset($row['type']) && $row['type'] ? $arg : FALSE;
}