You are here

function user_stats_cache_get in User Stats 7

Same name and namespace in other branches
  1. 6 user_stats.module \user_stats_cache_get()

Return data from the non-persistent User Stats cache. Single values are returned according to type of statistic and unique user id.

Parameters

$type: The type of statistic to retrieve, this corresponds to the statistic types used by user_stats_get_stats().

$uid: Unique ID of the user who's statistic is being retrieved.

Return value

A single value, representing the statistic $type where the unique user id is $uid. Or FALSE if there is no value in the cache for this combination of $type and $uid.

See also

user_stats_get_stats().

user_stats_cache_set().

2 calls to user_stats_cache_get()
user_stats_get_stats in ./user_stats.module
Returns user stats.
user_stats_login_count_update in ./user_stats.module
Manage the login count of a given user.

File

./user_stats.module, line 228
User Stats provides commonly requested user statistics for themers. These are:

Code

function user_stats_cache_get($type, $uid) {
  $user_stats_cache = user_stats_cache_set();
  if (isset($user_stats_cache[$uid][$type])) {
    return $user_stats_cache[$uid][$type];
  }
  else {
    return FALSE;
  }
}