Public Member Functions | |
ilSetting ($a_module="common") | |
Initialise Settings. | |
get ($a_keyword, $a_default_value=false) | |
get setting | |
delete ($a_keyword) | |
delete one value from settingstable public | |
getAll () | |
read all values from settingstable public | |
set ($a_key, $a_val) | |
write one value to db-table settings public | |
Data Fields | |
$setting = array() | |
$module = "" |
ILIAS Setting Class.
Definition at line 32 of file class.ilSetting.php.
ilSetting::delete | ( | $ | a_keyword | ) |
delete one value from settingstable public
string | keyword |
Definition at line 95 of file class.ilSetting.php.
References $query.
ilSetting::get | ( | $ | a_keyword, | |
$ | a_default_value = false | |||
) |
get setting
public
string | keyword | |
string | default_value This value is returned, when no setting has been found for the keyword. |
Definition at line 71 of file class.ilSetting.php.
{ if ($a_keyword == "ilias_version") { return ILIAS_VERSION; } if (isset($this->setting[$a_keyword])) { return $this->setting[$a_keyword]; } else { return $a_default_value; } }
ilSetting::getAll | ( | ) |
read all values from settingstable public
Definition at line 113 of file class.ilSetting.php.
{
return $this->setting;
}
ilSetting::ilSetting | ( | $ | a_module = "common" |
) |
Initialise Settings.
Definition at line 40 of file class.ilSetting.php.
References $query, $res, and $row.
{ global $ilDB; $this->module = $a_module; // check whether ini file object exists if (!is_object($ilDB)) { die ("Fatal Error: ilSettings object instantiated without DB initialisation."); } $query = "SELECT * FROM settings WHERE module=" . $ilDB->quote($this->module); $res = $ilDB->query($query); while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) { $this->setting[$row["keyword"]] = $row["value"]; } }
ilSetting::set | ( | $ | a_key, | |
$ | a_val | |||
) |
write one value to db-table settings public
string | keyword | |
string | value |
Definition at line 125 of file class.ilSetting.php.
{ global $ilDB; $sql = "DELETE FROM settings WHERE keyword=".$ilDB->quote($a_key). " AND module=" . $ilDB->quote($this->module); $ilDB->query($sql); $sql = "INSERT INTO settings (module, keyword, value) VALUES (". $ilDB->quote($this->module) . ",".$ilDB->quote($a_key).",".$ilDB->quote($a_val).")"; $ilDB->query($sql); $this->setting[$a_key] = $a_val; return true; }
ilSetting::$module = "" |
Definition at line 35 of file class.ilSetting.php.
ilSetting::$setting = array() |
Definition at line 34 of file class.ilSetting.php.