Commit 70b13427 authored by mrweiner's avatar mrweiner

remove bad @cache dependency, add to slot getter

parent 74728cd0
services:
cache_register.manager:
class: Drupal\cache_register\Manager
arguments: [ '@cache', '@cache.data' ]
arguments: [ '@cache.data' ]
#
# Not really sure if there's a benefit to doing this,
......
......@@ -106,8 +106,12 @@ class Slot implements SlotInterface {
/**
* {@inheritDoc}
*/
public function getCache() {
return $this->cache->get($this->id);
public function getCache($data_only = FALSE) {
if (!$cache_item = $this->cache->get($this->id)) {
return FALSE;
}
return $data_only ? $cache_item->data : $cache_item;
}
/**
......
......@@ -54,10 +54,14 @@ interface SlotInterface {
/**
* Gets the slots cache entry.
*
* @param bool $data_only
* If true, returns the data cache entry's data
* instead of the entry itself.
*
* @return object|false
* The cache item or FALSE on failure.
*/
public function getCache();
public function getCache($data_only = FALSE);
/**
* 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