Esclusione esecuzione hook inutilizzati

This commit is contained in:
Beppe 2020-02-07 12:41:54 +01:00
parent a5034e8d0b
commit 6ac418e27f
1 changed files with 15 additions and 13 deletions

View File

@ -52,21 +52,23 @@ abstract class CachedManager extends Manager
{ {
$hook = self::getHook(); $hook = self::getHook();
// Rimozione cache precedente if( !empty($hook) ){
$database = database(); // Rimozione cache precedente
$database->delete('zz_hook_cache', [ $database = database();
'hook_id' => $hook->id, $database->delete('zz_hook_cache', [
]); 'hook_id' => $hook->id,
]);
// Aggiunta del risultato come cache // Aggiunta del risultato come cache
$cache = json_encode($results); $cache = json_encode($results);
$database->insert('zz_hook_cache', [ $database->insert('zz_hook_cache', [
'hook_id' => $hook->id, 'hook_id' => $hook->id,
'results' => $cache, 'results' => $cache,
]); ]);
self::$cache = $results; self::$cache = $results;
self::$is_cached = null; self::$is_cached = null;
}
} }
public static function isCached() public static function isCached()