- Banners frontend: front\Views\Banners (new), BannerRepository +2 frontend methods, front\view\Site przepięty, usunięte front\factory\Banners i front\view\Banners - Cache cleanup: eliminacja legacy class.Cache.php (file-based cache), 13 metod front\factory przepiętych z \Cache::fetch/store na CacheHandler - Shared\Cache namespace: CacheHandler i RedisConnection przeniesione do Shared\Cache\, 60 odwołań CacheHandler i 12 odwołań RedisConnection przepiętych, usunięte backward-compat wrappery class.CacheHandler.php i class.RedisConnection.php - Naprawione rozbieżności kluczy cache (random_products, category_name) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
944 B
PHP
39 lines
944 B
PHP
<?php
|
|
namespace front\factory;
|
|
|
|
class Scontainers
|
|
{
|
|
public static function scontainer_details($scontainer_id)
|
|
{
|
|
global $mdb, $lang;
|
|
|
|
$cacheHandler = new \Shared\Cache\CacheHandler();
|
|
$cacheKey = "\front\factory\Scontainers::scontainer_details:$scontainer_id";
|
|
|
|
$objectData = $cacheHandler->get($cacheKey);
|
|
if ($objectData) {
|
|
return unserialize($objectData);
|
|
}
|
|
|
|
$repository = new \Domain\Scontainers\ScontainersRepository($mdb);
|
|
$langId = (string)($lang[0] ?? 'pl');
|
|
$scontainer = $repository->detailsForLanguage((int)$scontainer_id, $langId);
|
|
|
|
if (!is_array($scontainer)) {
|
|
$scontainer = [
|
|
'id' => (int)$scontainer_id,
|
|
'status' => 0,
|
|
'show_title' => 0,
|
|
'languages' => [
|
|
'lang_id' => $langId,
|
|
'title' => '',
|
|
'text' => '',
|
|
],
|
|
];
|
|
}
|
|
|
|
$cacheHandler->set($cacheKey, $scontainer);
|
|
|
|
return $scontainer;
|
|
}
|
|
} |