Added warning if cache isn't set

This commit is contained in:
Hillel Coren 2016-03-07 17:26:57 +02:00
parent 93d9d38286
commit a36626843d

View File

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