ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 <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.

References $ilDB, and __getSettings().

22  {
23  global $ilDB;
24 
25  $this->db = $ilDB;
26  $this->__getSettings();
27  }
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ __getSettings()

ilPaymentSettings::__getSettings ( )
private

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

References $res, and $row.

Referenced by __construct().

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  }
+ Here is the caller graph for this function:

◆ _getInstance()

static ilPaymentSettings::_getInstance ( )
static

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

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

12  {
13  if(!isset(self::$_instance))
14  {
15  self::$_instance = new ilPaymentSettings();
16  }
17 
18  return self::$_instance;
19  }
+ Here is the caller graph for this function:

◆ _isPaymentEnabled()

static ilPaymentSettings::_isPaymentEnabled ( )
static

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

Referenced by ilInitialisation\initSettings().

115  {
116  if(!isset(self::$_instance))
117  {
118  self::_getInstance();
119  }
120 
121  return self::$_instance->setting['shop_enabled'];
122  }
+ Here is the caller graph for this function:

◆ delete()

ilPaymentSettings::delete (   $a_key)

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

References $ilDB.

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

◆ 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.

41  {
42  return $this->setting;
43  }

◆ getMailBillingText()

static ilPaymentSettings::getMailBillingText ( )
static

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

Referenced by ilObjPaymentSettingsGUI\BillingMailObject().

144  {
145  if(!isset(self::$_instance))
146  {
147  self::_getInstance();
148  }
149 
150  return self::$_instance->setting['mail_billing_text'];
151 
152  }
+ Here is the caller graph for this function:

◆ getMailUsePlaceholders()

static ilPaymentSettings::getMailUsePlaceholders ( )
static

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

Referenced by ilObjPaymentSettingsGUI\BillingMailObject().

129  {
130  if(!isset(self::$_instance))
131  {
132  self::_getInstance();
133  }
134 
135  return self::$_instance->setting['mail_use_placeholders'];
136  }
+ Here is the caller graph for this function:

◆ getValuesByScope()

ilPaymentSettings::getValuesByScope (   $a_scope)

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

References $ilDB, $res, and $row.

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  }
global $ilDB

◆ set()

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

<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.

References $ilDB, $res, and $row.

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  }
global $ilDB

◆ setMailBillingText()

static ilPaymentSettings::setMailBillingText (   $a_mail_billing_text)
static

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

Referenced by ilObjPaymentSettingsGUI\saveBillingMailObject().

139  {
140  self::set('mail_billing_text',$a_mail_billing_text);
141  }
+ 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.

Referenced by ilObjPaymentSettingsGUI\saveBillingMailObject().

124  {
125  self::set('mail_use_placeholders',$a_mail_use_placeholders);
126  }
+ 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  {
158  self::_getInstance();
159  }
160 
161  return self::$_instance->setting['use_shop_specials'];
162 
163  }

Field Documentation

◆ $_instance

ilPaymentSettings::$_instance
staticprivate

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

◆ $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: