Facturacion

This commit is contained in:
2023-11-22 19:08:19 -03:00
parent b4742a501e
commit 9ab0515954
45 changed files with 1846 additions and 71 deletions

View File

@ -14,11 +14,15 @@ trait withRedis
}
return json_decode($jsonString);
}
public function saveRedis(Service\Redis $redisService, string $redisKey, mixed $value): void
public function saveRedis(Service\Redis $redisService, string $redisKey, mixed $value, ?int $expiration = null): void
{
if (is_array($value) or is_object($value)) {
$value = json_encode($value);
}
if ($expiration !== null) {
$redisService->set($redisKey, $value, $expiration);
return;
}
$redisService->set($redisKey, $value);
}
}