shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

setting.php (1548B)


      1 <?php
      2 /*
      3  *  location: admin/model/extension/d_opencart_patch/setting.php
      4  *
      5  */
      6 
      7 class ModelExtensionDOpencartPatchSetting extends Model {
      8     public function getSetting($code, $store_id = 0) {
      9         $this->load->model('setting/setting');
     10         return $this->model_setting_setting->getSetting($code, $store_id);
     11     }
     12 
     13     public function editSetting($code, $data, $store_id = 0) {
     14         $this->load->model('setting/setting');
     15         $this->model_setting_setting->editSetting($code, $data, $store_id);
     16     }
     17 
     18     public function deleteSetting($code, $store_id = 0) {
     19         $this->load->model('setting/setting');
     20         return $this->model_setting_setting->deleteSetting($code, $store_id);
     21     }
     22     public function getSettingValue($key, $store_id = 0){
     23         $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '" . (int)$store_id . "' AND `key` = '" . $this->db->escape($key) . "'");
     24         if (empty($query->num_rows)) {
     25             return null;
     26         }
     27         if (!$query->row['serialized']) {
     28             return $query->row['value'];
     29         } else {
     30             if (VERSION >= '2.2.0.0') {
     31                 return json_decode($query->row['value'], true);
     32             } else {
     33                 return unserialize($query->row['value']);
     34             }
     35         }
     36     }
     37     public function editSettingValue($code = '', $key = '', $value = '', $store_id = 0) {
     38         $this->load->model('setting/setting');
     39         $this->model_setting_setting->editSettingValue($code, $key, $value, $store_id);
     40     }
     41 }