Commit 16a7d23b authored by mrweiner's avatar mrweiner

Add getCacheData() method instead of option

parent 70b13427
......@@ -102,16 +102,22 @@ class Slot implements SlotInterface {
return TRUE;
}
/**
* {@inheritDoc}
*/
public function getCache() {
return $this->cache->get($this->id);
}
/**
* {@inheritDoc}
*/
public function getCache($data_only = FALSE) {
public function getCacheData() {
if (!$cache_item = $this->cache->get($this->id)) {
return FALSE;
}
return $data_only ? $cache_item->data : $cache_item;
return $cache_item->data;
}
/**
......
......@@ -52,16 +52,25 @@ interface SlotInterface {
public function addCacheTags($tags);
/**
* Gets the slots cache entry.
*
* @param bool $data_only
* If true, returns the data cache entry's data
* instead of the entry itself.
* Gets the slot's cache entry.
*
* @return object|false
* The cache item or FALSE on failure.
*/
public function getCache($data_only = FALSE);
public function getCache();
/**
* Gets the data from the slot's cache entry.
*
* Do not use this method if the data itself is
* a boolean, as there is no way to tell whether
* FALSE was returned because the cache is not set
* or because the value of the data is FALSE.
*
* @return mixed
* The cache item's data or FALSE on failure.
*/
public function getCacheData();
/**
* Delete the slot's cache entry.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment