You are here

function ctools_object_cache_test_objects in Chaos Tool Suite (ctools) 7

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

Get the cache status of a group of objects.

This is useful for displaying lock status when listing a number of objects an an administration UI.

Parameters

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

$names: An array of names of objects

Return value

An array of objects containing the UID and updated date for each name found.

1 call to ctools_object_cache_test_objects()
page_manager_list_page in page_manager/page_manager.admin.inc
Output a list of pages that are managed.

File

includes/object-cache.inc, line 168
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_test_objects($obj, $names) {
  array_walk($names, 'md5');
  return db_query("SELECT c.name, s.uid, c.updated FROM {ctools_object_cache} c INNER JOIN {sessions} s ON c.sid = s.sid WHERE c.obj = :obj AND c.name IN (:names) ORDER BY c.updated ASC", array(
    ':obj' => $obj,
    ':names' => $names,
  ))
    ->fetchAllAssoc('name');
}