function oa_core_get_cache in Open Atrium Core 7.2
Helper function to get a value from static or db cache
Parameters
$cid : the cache id (see oa_core_get_cache_id):
$value : the value returned:
Return value
bool : TRUE if cache value is returned
5 calls to oa_core_get_cache()
- oa_core_get_groups_by_parent in includes/
oa_core.util.inc - Get child Spaces or Groups.
- oa_core_get_groups_by_user in includes/
oa_core.util.inc - Get the group IDs of all the groups a user is an approved member of.
- oa_core_get_groups_by_user_access in includes/
oa_core.util.inc - Get the group IDs and Titles of all the groups a user is an approved member of.
- oa_core_get_parents_with_titles in includes/
oa_core.util.inc - Get parent Spaces and Groups.
- oa_core_get_top_parents in includes/
oa_core.util.inc - Get top-level spaces/groups (no parents of same bundle type)
File
- includes/
oa_core.cache.inc, line 13 - Code for OpenAtrium caching helpers
Code
function oa_core_get_cache($name, $cid, &$value) {
$static_cache =& drupal_static($name);
if (isset($static_cache[$cid])) {
$value = $static_cache[$cid];
return TRUE;
}
if ($cache = cache_get($cid)) {
$static_cache[$cid] = $cache->data;
$value = $cache->data;
return TRUE;
}
return FALSE;
}