<?php

namespace MGModule\DNSManager2\mgLibs\custom\manager;

use MGModule\DNSManager2\models\custom\globalsetting;

//TODO: w przyszlosci jak starczy czasu usunac to globalnie
class GlobalSettingHelper {    
    public static function getSetting($key, $value_only = true) {
        $setting = globalsetting\GlobalSetting::byKey($key);
        if(!$setting = globalsetting\GlobalSetting::byKey($key)) {
            return false;
        }
        return $value_only?$setting->value:$setting;
    }
    
    public static function setSetting($key, $value) {
        globalsetting\GlobalSetting::set($key, $value);
    }

}