Added warning if cache isn't set

This commit is contained in:
Hillel Coren 2016-03-07 17:22:20 +02:00
parent 3e26f97e8b
commit 52d25192af

View File

@ -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;
});