11
This commit is contained in:
@ -29,6 +29,7 @@ abstract class BaseCache
|
||||
{
|
||||
$sCacheKey = $this->getPrimaryKey();
|
||||
$aData = $this->loadData();
|
||||
|
||||
if (empty($aData)) return false;
|
||||
return Cache::put($sCacheKey, $aData, self::CACHE_TTL);
|
||||
}
|
||||
@ -46,12 +47,14 @@ abstract class BaseCache
|
||||
|
||||
function getCacheData($primary_key = null): array|string|null
|
||||
{
|
||||
|
||||
if ($primary_key === null) $primary_key = $this->primary_key;
|
||||
if (empty($primary_key)) return [];
|
||||
$sCacheKey = $this->getPrimaryKey($primary_key);
|
||||
$sData = Cache::get($sCacheKey);
|
||||
if (empty($sData)) {
|
||||
$this->primary_key = $primary_key;
|
||||
|
||||
if ($this->loadToCache()) $sData = Cache::get($sCacheKey);
|
||||
}
|
||||
if (empty($sData)) return null;
|
||||
|
||||
Reference in New Issue
Block a user