function oa_core_get_cache_id in Open Atrium Core 7.2
Helper function to return a caching ids.
Parameters
$cache_name : The name of the cache table.:
null $id : if not-null, adds the id to the cache id. Typically passes the $user->uid:
bool $include_archived : if TRUE, adds _archived to the cache id:
array $args : appends each argument to the cache id:
Return value
string : the cache_id for cache_get/set
6 calls to oa_core_get_cache_id()
- 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 57 - Code for OpenAtrium caching helpers
Code
function oa_core_get_cache_id($cache_name, $id = NULL, $include_archived = FALSE, $args = array()) {
$cid = $cache_name . '_';
if (!empty($id)) {
$cid .= $id;
if ($include_archived) {
$cid .= '_archived';
}
foreach ($args as $arg) {
if (!empty($arg) && is_array($arg)) {
$cid .= '_' . implode(':', $arg);
}
else {
$cid .= '_' . (!empty($arg) ? $arg : '');
}
}
}
return $cid;
}