You are here

function ctools_object_cache_clear_all in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/object-cache.inc \ctools_object_cache_clear_all()

Remove an object from the non-volatile ctools cache for all session IDs.

This is useful for clearing a lock.

Parameters

$obj: A 128 character or less string to define what kind of object is being stored; primarily this is used to prevent collisions.

$name: The name of the object being removed.

1 call to ctools_object_cache_clear_all()
page_manager_break_lock_submit in page_manager/page_manager.admin.inc
Submit to break the lock on a page.

File

includes/object-cache.inc, line 185
The non-volatile object cache is used to store an object while it is being edited, so that we don't have to save until we're completely done. The cache should be 'cleaned' on a regular basis, meaning to remove old objects from the…

Code

function ctools_object_cache_clear_all($obj, $name) {
  db_delete('ctools_object_cache')
    ->condition('obj', $obj)
    ->condition('name', md5($name))
    ->execute();

  // Ensure the static cache is emptied of this obj:name set.
  $cache =& drupal_static('ctools_object_cache_get', array());
  unset($cache["{$obj}:{$name}"]);
}