GlobalSettingHelper.php 641 B

123456789101112131415161718192021
  1. <?php
  2. namespace MGModule\DNSManager2\mgLibs\custom\manager;
  3. use MGModule\DNSManager2\models\custom\globalsetting;
  4. //TODO: w przyszlosci jak starczy czasu usunac to globalnie
  5. class GlobalSettingHelper {
  6. public static function getSetting($key, $value_only = true) {
  7. $setting = globalsetting\GlobalSetting::byKey($key);
  8. if(!$setting = globalsetting\GlobalSetting::byKey($key)) {
  9. return false;
  10. }
  11. return $value_only?$setting->value:$setting;
  12. }
  13. public static function setSetting($key, $value) {
  14. globalsetting\GlobalSetting::set($key, $value);
  15. }
  16. }