Added warning if cache isn't set
This commit is contained in:
parent
3e26f97e8b
commit
52d25192af
1 changed files with 8 additions and 1 deletions
|
|
@ -281,7 +281,14 @@ class Utils
|
|||
}
|
||||
|
||||
public static function getFromCache($id, $type) {
|
||||
$data = Cache::get($type)->filter(function($item) use ($id) {
|
||||
$cache = Cache::get($type);
|
||||
|
||||
if ( ! $cache) {
|
||||
static::logError("Cache for {$type} is not set");
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = $cache->filter(function($item) use ($id) {
|
||||
return $item->id == $id;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue