Public Member Functions | |
| ilGeneralSettings () | |
| setSettingsId ($a_settings_id=0) | |
| getSettingsId () | |
| get ($a_type) | |
| getAll () | |
| clearAll () | |
| setAll ($a_values) | |
| __getSettings () | |
Data Fields | |
| $db | |
| $settings | |
Private Member Functions | |
| fetchSettingsId () | |
| Fetches and sets the primary key of the payment settings. | |
Definition at line 24 of file class.ilGeneralSettings.php.
| ilGeneralSettings::__getSettings | ( | ) |
Definition at line 127 of file class.ilGeneralSettings.php.
References $data, 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;
}
$this->settings = $data;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilGeneralSettings::clearAll | ( | ) |
Definition at line 71 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 .= "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 44 of file class.ilGeneralSettings.php.
References 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 61 of file class.ilGeneralSettings.php.
{
return $this->settings[$a_type];
}
| ilGeneralSettings::getAll | ( | ) |
Definition at line 66 of file class.ilGeneralSettings.php.
{
return $this->settings;
}
| ilGeneralSettings::getSettingsId | ( | ) |
Definition at line 56 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 30 of file class.ilGeneralSettings.php.
References __getSettings().
{
global $ilDB;
$this->db =& $ilDB;
$this->__getSettings();
}
Here is the call graph for this function:| ilGeneralSettings::setAll | ( | $ | a_values | ) |
Definition at line 88 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 .= "WHERE settings_id = '" . $this->getSettingsId() . "'";
$this->db->query($query);
}
else
{
$query = "INSERT INTO payment_settings (currency_unit, currency_subunit, address, bank_data, add_info, vat_rate, pdf_path) VALUES (";
$query .= $ilDB->quote($a_values["currency_unit"]) . ", ";
$query .= $ilDB->quote($a_values["currency_subunit"]) . ", ";
$query .= $ilDB->quote($a_values["address"]) . ", ";
$query .= $ilDB->quote($a_values["bank_data"]) . ", ";
$query .= $ilDB->quote($a_values["add_info"]) . ", ";
$query .= $ilDB->quote($a_values["vat_rate"]) . ", ";
$query .= $ilDB->quote($a_values["pdf_path"]) . ")";
$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 52 of file class.ilGeneralSettings.php.
Referenced by fetchSettingsId(), and setAll().
{
$this->settings_id = $a_settings_id;
}
Here is the caller graph for this function:| ilGeneralSettings::$db |
Definition at line 26 of file class.ilGeneralSettings.php.
| ilGeneralSettings::$settings |
Definition at line 28 of file class.ilGeneralSettings.php.
1.7.1