ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGeneralSettings Class Reference
+ Collaboration diagram for ilGeneralSettings:

Public Member Functions

 ilGeneralSettings ()
 setSettingsId ($a_settings_id=0)
 getSettingsId ()
 get ($a_type)
 getAll ()
 clearAll ()
 setAll ($a_values)
 __getSettings ()

Static Public Member Functions

static _getInstance ()

Data Fields

 $db
 $settings

Private Member Functions

 fetchSettingsId ()
 Fetches and sets the primary key of the payment settings.

Static Private Attributes

static $_instance

Detailed Description

Definition at line 24 of file class.ilGeneralSettings.php.

Member Function Documentation

ilGeneralSettings::__getSettings ( )

Definition at line 153 of file class.ilGeneralSettings.php.

References $data, $result, and fetchSettingsId().

Referenced by ilGeneralSettings(), and setAll().

{
$this->fetchSettingsId();
$query = "SELECT * FROM payment_settings";
$result = $this->db->getrow($query);
$data = array();
if (is_object($result))
{
$data["currency_unit"] = $result->currency_unit;
$data["currency_subunit"] = $result->currency_subunit;
$data["address"] = $result->address;
$data["bank_data"] = $result->bank_data;
$data["add_info"] = $result->add_info;
$data["vat_rate"] = $result->vat_rate;
$data["pdf_path"] = $result->pdf_path;
$data["topics_allow_custom_sorting"] = $result->topics_allow_custom_sorting;
$data["topics_sorting_type"] = $result->topics_sorting_type;
$data["topics_sorting_direction"] = $result->topics_sorting_direction;
$data["max_hits"] = $result->max_hits;
$data["shop_enabled"] = $result->shop_enabled;
}
$this->settings = $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilGeneralSettings::_getInstance ( )
static
ilGeneralSettings::clearAll ( )

Definition at line 82 of file class.ilGeneralSettings.php.

References getSettingsId().

{
$query = "UPDATE payment_settings ";
$query .= "SET currency_unit = '', ";
$query .= "currency_subunit = '', ";
$query .= "address = '', ";
$query .= "bank_data = '', ";
$query .= "add_info = '', ";
$query .= "vat_rate = '', ";
$query .= "pdf_path = '', ";
$query .= "topics_sorting_type = 1, ";
$query .= "topics_sorting_direction = 'asc', ";
$query .= "topics_allow_custom_sorting = 0, ";
$query .= "max_hits = 20, ";
$query .= "shop_enabled = 0 ";
$query .= "WHERE settings_id = '" . $this->getSettingsId() . "'";
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilGeneralSettings::fetchSettingsId ( )
private

Fetches and sets the primary key of the payment settings.

private

Definition at line 55 of file class.ilGeneralSettings.php.

References $result, and setSettingsId().

Referenced by __getSettings().

{
$query = "SELECT * FROM payment_settings";
$result = $this->db->getrow($query);
$this->setSettingsId($result->settings_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGeneralSettings::get (   $a_type)

Definition at line 72 of file class.ilGeneralSettings.php.

{
return $this->settings[$a_type];
}
ilGeneralSettings::getAll ( )

Definition at line 77 of file class.ilGeneralSettings.php.

References $settings.

{
}
ilGeneralSettings::getSettingsId ( )

Definition at line 67 of file class.ilGeneralSettings.php.

Referenced by clearAll(), and setAll().

{
return $this->settings_id;
}

+ Here is the caller graph for this function:

ilGeneralSettings::ilGeneralSettings ( )

Definition at line 41 of file class.ilGeneralSettings.php.

References __getSettings().

Referenced by _getInstance().

{
global $ilDB;
$this->db =& $ilDB;
$this->__getSettings();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGeneralSettings::setAll (   $a_values)

Definition at line 104 of file class.ilGeneralSettings.php.

References __getSettings(), getSettingsId(), and setSettingsId().

{
global $ilDB;
if ($this->getSettingsId())
{
$query = "UPDATE payment_settings ";
$query .= "SET currency_unit = " . $ilDB->quote($a_values["currency_unit"]) . ", ";
$query .= "currency_subunit = " . $ilDB->quote($a_values["currency_subunit"]) . ", ";
$query .= "address = " . $ilDB->quote($a_values["address"]) . ", ";
$query .= "bank_data = " . $ilDB->quote($a_values["bank_data"]) . ", ";
$query .= "add_info = " . $ilDB->quote($a_values["add_info"]) . ", ";
$query .= "vat_rate = " . $ilDB->quote($a_values["vat_rate"]) . ", ";
$query .= "pdf_path = " . $ilDB->quote($a_values["pdf_path"]) . ", ";
$query .= "topics_allow_custom_sorting = " . $ilDB->quote($a_values["topics_allow_custom_sorting"]) . ", ";
$query .= "topics_sorting_type = " . $ilDB->quote($a_values["topics_sorting_type"]) . ", ";
$query .= "topics_sorting_direction = " . $ilDB->quote($a_values["topics_sorting_direction"]) . ", ";
$query .= "max_hits = " . $ilDB->quote($a_values["max_hits"]) . ", ";
$query .= "shop_enabled = " . $ilDB->quote($a_values["shop_enabled"]) . " ";
$query .= "WHERE settings_id = '" . $this->getSettingsId() . "'";
$this->db->query($query);
}
else
{
$query = "INSERT INTO payment_settings
SET
currency_unit = ".$ilDB->quote($a_values["currency_unit"]).",
currency_subunit = ".$ilDB->quote($a_values["currency_subunit"]).",
address = ".$ilDB->quote($a_values["address"]).",
bank_data = ".$ilDB->quote($a_values["bank_data"]).",
add_info = ".$ilDB->quote($a_values["add_info"]).",
vat_rate = ".$ilDB->quote($a_values["vat_rate"]).",
pdf_path = ".$ilDB->quote($a_values["pdf_path"]).",
topics_allow_custom_sorting = ".$ilDB->quote($a_values["topics_allow_custom_sorting"]).",
topics_sorting_type = ".$ilDB->quote($a_values["topics_sorting_type"]).",
topics_sorting_direction = ".$ilDB->quote($a_values["topics_sorting_direction"]).",
shop_enabled = ".$ilDB->quote($a_values["shop_enabled"]).",
max_hits = ".$ilDB->quote($a_values["topics_sorting_direction"]);
$this->db->query($query);
$this->setSettingsId($this->db->getLastInsertId());
}
$this->__getSettings();
return true;
}

+ Here is the call graph for this function:

ilGeneralSettings::setSettingsId (   $a_settings_id = 0)

Definition at line 63 of file class.ilGeneralSettings.php.

Referenced by fetchSettingsId(), and setAll().

{
$this->settings_id = $a_settings_id;
}

+ Here is the caller graph for this function:

Field Documentation

ilGeneralSettings::$_instance
staticprivate

Definition at line 26 of file class.ilGeneralSettings.php.

Referenced by _getInstance().

ilGeneralSettings::$db

Definition at line 28 of file class.ilGeneralSettings.php.

ilGeneralSettings::$settings

Definition at line 29 of file class.ilGeneralSettings.php.

Referenced by getAll().


The documentation for this class was generated from the following file: