You are here

function gmap_taxonomy_get_markers in GMap Module 7

Same name and namespace in other branches
  1. 7.2 gmap_taxonomy.module \gmap_taxonomy_get_markers()

Get all gmap taxonomy markers Helper function to return cached version of gmap taxonomy markers from the database

Return value

Associative array of tid => marker.

1 call to gmap_taxonomy_get_markers()
gmap_taxonomy_node_update in ./gmap_taxonomy.module
Implement hook_node_update().

File

./gmap_taxonomy.module, line 231
GMap Taxonomy Markers

Code

function gmap_taxonomy_get_markers() {
  $gmap_taxonomy_markers =& drupal_static(__FUNCTION__);
  if (!isset($gmap_taxonomy_markers)) {
    if ($cache = cache_get('gmap_taxonomy_markers_data')) {
      $gmap_taxonomy_markers = $cache->data;
    }
    else {
      $gmap_taxonomy_markers = db_query('SELECT tid, marker FROM {gmap_taxonomy_term}')
        ->fetchAllKeyed();
      cache_set('gmap_taxonomy_markers_data', $gmap_taxonomy_markers, 'cache', CACHE_TEMPORARY);
    }
  }
  return $gmap_taxonomy_markers;
}