ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPaymentSettings Class Reference
+ Collaboration diagram for ilPaymentSettings:

Public Member Functions

 getAll ()
 
 get ($a_key)
 
 getValuesByScope ($a_scope)
 
 set ($a_key, $a_val, $a_scope=null)
 @global <type> $ilDB More...
 
 delete ($a_key)
 

Static Public Member Functions

static _getInstance ()
 
static _isPaymentEnabled ()
 
static setMailUsePlaceholders ($a_mail_use_placeholders)
 
static getMailUsePlaceholders ()
 
static setMailBillingText ($a_mail_billing_text)
 
static getMailBillingText ()
 
static useShopSpecials ()
 

Data Fields

 $db
 
 $setting = array()
 

Private Member Functions

 __construct ()
 
 __getSettings ()
 

Static Private Attributes

static $_instance
 

Detailed Description

Definition at line 4 of file class.ilPaymentSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilPaymentSettings::__construct ( )
private

Definition at line 21 of file class.ilPaymentSettings.php.

22 {
23 global $ilDB;
24
25 $this->db = $ilDB;
26 $this->__getSettings();
27 }
global $ilDB

References $ilDB, and __getSettings().

+ Here is the call graph for this function:

Member Function Documentation

◆ __getSettings()

ilPaymentSettings::__getSettings ( )
private

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

30 {
31 $res = $this->db->query('SELECT * FROM payment_settings');
32
33 $this->setting = array();
34 while($row = $this->db->fetchAssoc($res))
35 {
36 $this->setting[$row["keyword"]] = $row["value"];
37 }
38 }

References $res, and $row.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ _getInstance()

static ilPaymentSettings::_getInstance ( )
static

Definition at line 11 of file class.ilPaymentSettings.php.

12 {
13 if(!isset(self::$_instance))
14 {
15 self::$_instance = new ilPaymentSettings();
16 }
17
18 return self::$_instance;
19 }

References $_instance.

Referenced by ilPurchasePaypal\__checkItems(), ilObjPaymentSettingsGUI\__construct(), ilAdvancedSearchFilterGUI\__construct(), ilShopFilterGUI\__construct(), ilPaymentBookings\__construct(), ilPaypalSettings\__construct(), ilShopBaseGUI\__construct(), ilShopGUI\__construct(), ilUserDefinedInvoiceNumber\__construct(), ilShopSearchResult\__initSearchSettingsObject(), ilPurchaseBaseGUI\__sendBill(), ilPurchaseBaseGUI\__showItemsTable(), ilPurchaseBaseGUI\__showShoppingCart(), ilPaymentPrices\_formatPriceToString(), ilUserDefinedInvoiceNumber\_getIncCurrentValue(), ilPaymentPrices\_getPriceStringFromAmount(), ilUserDefinedInvoiceNumber\_getResetPeriod(), _isPaymentEnabled(), ilUserDefinedInvoiceNumber\_isUDInvoiceNumberActive(), ilUserDefinedInvoiceNumber\_nextIncCurrentValue(), ilUserDefinedInvoiceNumber\_setIncCurrentValue(), ilPaymentStatisticGUI\addCustomer(), ilObjPaymentSettingsGUI\addCustomerObject(), ilPaymentAdminGUI\buildSubTabs(), ilShopController\buildTabs(), ilShopBoughtObjectsGUI\createBill(), ilObjPaymentSettingsGUI\editPriceObject(), ilShopController\executeCommand(), getMailBillingText(), getMailUsePlaceholders(), ilBMFSettings\ilBMFSettings(), ilObjPaymentSettingsGUI\saveCustomerObject(), ilShopTopicsGUI\saveTopicsSettings(), ilShopShoppingCartGUI\showCouponInput(), ilShopShoppingCartGUI\showItems(), ilShopShoppingCartGUI\showItemsTable(), ilShopTopicsGUI\showTopicsSettings(), and useShopSpecials().

+ Here is the caller graph for this function:

◆ _isPaymentEnabled()

static ilPaymentSettings::_isPaymentEnabled ( )
static

Definition at line 114 of file class.ilPaymentSettings.php.

115 {
116 if(!isset(self::$_instance))
117 {
119 }
120
121 return self::$_instance->setting['shop_enabled'];
122 }

References _getInstance().

Referenced by ilInitialisation\initSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilPaymentSettings::delete (   $a_key)

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

105 {
106 global $ilDB;
107
108 $ilDB->manipulateF('
109 DELETE FROM payment_settings
110 WHERE keyword = %s',
111 array('text'), array($a_key));
112 }

References $ilDB.

Referenced by set().

+ Here is the caller graph for this function:

◆ get()

ilPaymentSettings::get (   $a_key)

Definition at line 45 of file class.ilPaymentSettings.php.

46 {
47 return $this->setting[$a_key];
48 }

◆ getAll()

ilPaymentSettings::getAll ( )

Definition at line 40 of file class.ilPaymentSettings.php.

References $setting.

◆ getMailBillingText()

static ilPaymentSettings::getMailBillingText ( )
static

Definition at line 143 of file class.ilPaymentSettings.php.

144 {
145 if(!isset(self::$_instance))
146 {
148 }
149
150 return self::$_instance->setting['mail_billing_text'];
151
152 }

References _getInstance().

Referenced by ilObjPaymentSettingsGUI\BillingMailObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMailUsePlaceholders()

static ilPaymentSettings::getMailUsePlaceholders ( )
static

Definition at line 128 of file class.ilPaymentSettings.php.

129 {
130 if(!isset(self::$_instance))
131 {
133 }
134
135 return self::$_instance->setting['mail_use_placeholders'];
136 }

References _getInstance().

Referenced by ilObjPaymentSettingsGUI\BillingMailObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValuesByScope()

ilPaymentSettings::getValuesByScope (   $a_scope)

Definition at line 50 of file class.ilPaymentSettings.php.

51 {
52 global $ilDB;
53
54 $res = $ilDB->queryF('
55 SELECT * FROM payment_settings
56 WHERE scope = %s',
57 array('text'), array($a_scope));
58
59 $settings = array();
60 while($row = $this->db->fetchAssoc($res))
61 {
62 $settings[$row["keyword"]] = $row["value"];
63 }
64 return $settings;
65 }

References $ilDB, $res, and $row.

◆ set()

ilPaymentSettings::set (   $a_key,
  $a_val,
  $a_scope = null 
)

@global <type> $ilDB

Parameters
<text>$a_scope // define a payment-scope for settings (i.e. invoice, gui, common ... )
<text>$a_key
<text>$a_val
Returns
<type>

Definition at line 75 of file class.ilPaymentSettings.php.

76 {
77 global $ilDB;
78
79 if($a_scope == null)
80 {
81 // check if scope is already set
82 $res = $ilDB->queryF('
83 SELECT scope FROM payment_settings
84 WHERE keyword = %s',
85 array('text'), array($a_key));
86
87 $row = $ilDB->fetchAssoc($res);
88 $a_scope = $row['scope'];
89
90 }
91
92 self::delete($a_key);
93
94 $ilDB->insert("payment_settings", array(
95 "keyword" => array("text", $a_key),
96 "value" => array("clob", $a_val),
97 "scope" => array("text", $a_scope)));
98
99 self::$_instance->setting[$a_key] = $a_val;
100
101 return true;
102 }

References $ilDB, $res, $row, and delete().

Referenced by setMailBillingText(), and setMailUsePlaceholders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMailBillingText()

static ilPaymentSettings::setMailBillingText (   $a_mail_billing_text)
static

Definition at line 138 of file class.ilPaymentSettings.php.

139 {
140 self::set('mail_billing_text',$a_mail_billing_text);
141 }
set($a_key, $a_val, $a_scope=null)
@global <type> $ilDB

References set().

Referenced by ilObjPaymentSettingsGUI\saveBillingMailObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMailUsePlaceholders()

static ilPaymentSettings::setMailUsePlaceholders (   $a_mail_use_placeholders)
static

Definition at line 123 of file class.ilPaymentSettings.php.

124 {
125 self::set('mail_use_placeholders',$a_mail_use_placeholders);
126 }

References set().

Referenced by ilObjPaymentSettingsGUI\saveBillingMailObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ useShopSpecials()

static ilPaymentSettings::useShopSpecials ( )
static

Definition at line 154 of file class.ilPaymentSettings.php.

155 {
156 if(!isset(self::$_instance))
157 {
159 }
160
161 return self::$_instance->setting['use_shop_specials'];
162
163 }

References _getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $_instance

ilPaymentSettings::$_instance
staticprivate

Definition at line 6 of file class.ilPaymentSettings.php.

Referenced by _getInstance().

◆ $db

ilPaymentSettings::$db

Definition at line 8 of file class.ilPaymentSettings.php.

◆ $setting

ilPaymentSettings::$setting = array()

Definition at line 9 of file class.ilPaymentSettings.php.

Referenced by getAll().


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