12 const TABLE_NAME =
"ServerSettings";
15 public $DataValue =
"";
21 public function __construct($src = null, $stripSlashes =
false) {
26 $this->_loadByRow($src, $stripSlashes);
36 $serverClientKeys = array();
39 foreach ($recs as $rec) {
40 $settings[$rec->DataKey] = $rec->DataValue;
42 $serverClientKeys[$rec->DataKey] = $rec->DataValue;
53 public static function Load ($visible = FALSE) {
56 $where .= ($where ?
" AND " :
"") .
"(Visible = 1)";
58 return self::_load(self::GetTableName(__CLASS__), __CLASS__, $where);
68 $query = sprintf(
"REPLACE INTO %s (DataKey, DataValue, Visible) VALUES ('%s', '%s', %d)",
69 self::GetTableName(__CLASS__),
70 $Database->Escape($this->DataKey),
71 $Database->Escape($this->DataValue),
73 return $Database->Query($query);
84 return $this->_Delete(self::GetTableName(__CLASS__), sprintf(
"DataKey = '%s'", $Database->Escape($this->DataKey)));
__construct($src=null, $stripSlashes=false)
static GetCurrentSettings(&$serverClientKeys)
static Load($visible=FALSE)