cache = Services::cache(); $this->set_settings(); } public function set_settings(): void { if(!$this->cache->get('settings')) { $appconfig = model('Appconfig'); foreach($appconfig->get_all()->getResult() as $app_config) { $this->settings[$app_config->key] = $app_config->value; } $this->cache->save('settings', $this->settings); } $this->settings = $this->cache->get('settings'); } public function update_settings(): void { $this->cache->delete('settings'); $this->set_settings(); } }