atr_cache_static

Versions
6.1
&atr_cache_static($name, $value = NULL, $del = FALSE)

Set or get a statically cached item.

This function provides a general static cache similar to drupal_static() in Drupal 7, which allows multiple functions to access the same static cache.

Parameters

$name The name of the cache item to get or set.

$value The value of a cache item when setting it. NULL when reading the item.

$reset TRUE to reset an item. Internal use only, use atr_cache_static_del() instead.

Return value

The value of the cached item.

▾ 3 functions call atr_cache_static()

atr_cache_static_del in atr/atr.module
Delete an item from the static cache.
atr_review_load_multiple in atr/atr.module
Load multiple reviews.
atr_review_save in atr/atr.module
Save an existing review.

Code

atr/atr.module, line 316

<?php
function &atr_cache_static($name, $value = NULL, $del = FALSE) {
  static $cache = array();

  if ($del) {
    unset($cache_name);
    return;
  }
  elseif ($value) {
    $cache[$name] = $value;
  }
  elseif (!isset($cache[$name])) {
    $cache[$name] = NULL;
  }
  return $cache[$name];
}
?>