function views_content_cache_id_record in Views content cache 7.3
Same name and namespace in other branches
- 6.2 views_content_cache.module \views_content_cache_id_record()
Convert a cache id to an update record suitable for drupal_write_record() or use in a SELECT query.
Parameters
array $cid: An array representing a cache id where keys correspond to plugin key IDs and values are the cache id values generated by each plugin.
Return value
array An array where each plugin key ID has been replaced by one of the corresponding database columns c1 through c8.
2 calls to views_content_cache_id_record()
- views_content_cache_update_get in ./
views_content_cache.module - Retrieve the latest update record for a given cache id.
- views_content_cache_update_set in ./
views_content_cache.module - Create one or more update records for the given object.
File
- ./
views_content_cache.module, line 261 - Views content cache cache.
Code
function views_content_cache_id_record($cid) {
$map = views_content_cache_id_schema();
$record = array();
foreach ($cid as $key_id => $key_value) {
if ($key_id === 'timestamp') {
$record[$key_id] = $key_value;
}
elseif (isset($map[$key_id]) && ($column = $map[$key_id])) {
$record[$column] = $key_value;
}
}
return $record;
}