protected function RestfulBase::setRenderedCache in RESTful 7
Store an entry in the rendered cache.
Parameters
mixed $data: The data to be stored into the cache generated by \RestfulEntityInterface::viewEntity().
array $context: An associative array with additional information to build the cache ID.
Return value
array The rendered entity as returned by \RestfulEntityInterface::viewEntity().
See also
\RestfulEntityInterface::viewEntity().
4 calls to RestfulBase::setRenderedCache()
- RestfulDataProviderCToolsPlugins::view in plugins/
restful/ RestfulDataProviderCToolsPlugins.php - @todo: We should generalize this, as it's repeated often.
- RestfulDataProviderDbQuery::viewMultiple in plugins/
restful/ RestfulDataProviderDbQuery.php - View a collection of items.
- RestfulDataProviderVariable::viewVariable in plugins/
restful/ RestfulDataProviderVariable.php - View a single variable.
- RestfulEntityBase::viewEntity in plugins/
restful/ RestfulEntityBase.php - View an entity.
File
- plugins/
restful/ RestfulBase.php, line 1304 - Contains RestfulBase.
Class
- RestfulBase
- Class \RestfulBase
Code
protected function setRenderedCache($data, array $context = array()) {
$cache_info = $this
->getPluginKey('render_cache');
if (!$cache_info['render']) {
return;
}
$cid = $this
->generateCacheId($context);
$this
->getCacheController()
->set($cid, $data, $cache_info['expire']);
}