first(); if($m) { return $m; } else { return NULL; } } static public function getValueByName($name) { $m = SettingsHelper::getModelByName($name); if($m) { switch($m->type) { case 'boolean': return boolval($m->value); break; case 'integer': return intval($m->value); break; case 'float': return float($m->value); break; default: return $m->value; } } else { return NULL; } } static public function setValueByName($name, $value) { $m = SettingsHelper::getModelByName($name); if($m) { $value = strval($value); $m->value = $value; $m->save(); } return; } static public function hasMourningPile() { $value = SettingsHelper::getValueByName('mourning_pile'); return $value; } }