function panels_cache_get in Panels 6.2
Same name and namespace in other branches
- 5.2 panels.module \panels_cache_get()
- 6.3 panels.module \panels_cache_get()
- 7.3 panels.module \panels_cache_get()
Get an object from cache.
15 calls to panels_cache_get()
- panels_ajax_add_pane_choose in includes/
display-edit.inc - Entry point for AJAX: 'Add Content' modal form, from which the user selects the type of pane to add.
- panels_ajax_add_pane_config in includes/
display-edit.inc - AJAX entry point for to configure a pane that has just been added.
- panels_ajax_cache_method in includes/
display-edit.inc - Entry point for AJAX modal: configure pane cache method
- panels_ajax_cache_settings in includes/
display-edit.inc - Handle the cache settings form
- panels_ajax_configure_pane in includes/
display-edit.inc - AJAX entry point for to configure a pane that has just been added.
File
- ./
panels.module, line 246 - panels.module
Code
function panels_cache_get($obj, $did, $skip_cache = FALSE) {
static $cache = array();
$key = "{$obj}:{$did}";
if ($skip_cache) {
unset($cache[$key]);
}
if (!array_key_exists($key, $cache)) {
$data = db_fetch_object(db_query("SELECT * FROM {panels_object_cache} WHERE sid = '%s' AND obj = '%s' AND did = %d", session_id(), $obj, $did));
if ($data) {
$cache[$key] = unserialize($data->data);
}
}
return isset($cache[$key]) ? $cache[$key] : NULL;
}