feat: clear cache after settings update

This commit is contained in:
2025-11-13 10:47:06 +03:00
parent 24db69fbba
commit 6f9855995d

View File

@@ -2,15 +2,18 @@
namespace Bastion\Services; namespace Bastion\Services;
use Openguru\OpenCartFramework\Cache\CacheInterface;
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator; use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
class SettingsService class SettingsService
{ {
private OcRegistryDecorator $registry; private OcRegistryDecorator $registry;
private CacheInterface $cache;
public function __construct(OcRegistryDecorator $registry) public function __construct(OcRegistryDecorator $registry, CacheInterface $cache)
{ {
$this->registry = $registry; $this->registry = $registry;
$this->cache = $cache;
} }
public function update(array $data): void public function update(array $data): void
@@ -18,5 +21,7 @@ class SettingsService
$this->registry->model_setting_setting->editSetting('module_telecart', [ $this->registry->model_setting_setting->editSetting('module_telecart', [
'module_telecart_settings' => $data, 'module_telecart_settings' => $data,
]); ]);
$this->cache->clear();
} }
} }