feat: clear cache after settings update
This commit is contained in:
@@ -2,15 +2,18 @@
|
||||
|
||||
namespace Bastion\Services;
|
||||
|
||||
use Openguru\OpenCartFramework\Cache\CacheInterface;
|
||||
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
||||
|
||||
class SettingsService
|
||||
{
|
||||
private OcRegistryDecorator $registry;
|
||||
private CacheInterface $cache;
|
||||
|
||||
public function __construct(OcRegistryDecorator $registry)
|
||||
public function __construct(OcRegistryDecorator $registry, CacheInterface $cache)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
||||
public function update(array $data): void
|
||||
@@ -18,5 +21,7 @@ class SettingsService
|
||||
$this->registry->model_setting_setting->editSetting('module_telecart', [
|
||||
'module_telecart_settings' => $data,
|
||||
]);
|
||||
|
||||
$this->cache->clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user