You are here

function panels_common_cache_get in Panels 5.2

Get an object from cache.

9 calls to panels_common_cache_get()
panels_cache_get in ./panels.module
Get a display from the cache; this is used if the display is currently being edited, which can be a seriously multi-step process.
panels_common_ajax_context_item_add in includes/common.inc
Ajax entry point to add an context
panels_common_ajax_context_item_edit in includes/common.inc
Ajax entry point to edit an item
panels_mini_edit_context in panels_mini/panels_mini.module
Form to edit context features of a mini panel.
panels_node_context_edit in panels_node/panels_node.module
Edit contexts of a panel node.

... See full list

File

./panels.module, line 320
panels.module Core API for Panels. Provides display editing and rendering capabilities.

Code

function panels_common_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;
}