ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPayMethods Class Reference

Class ilObjPaymentSettingsGUI. More...

+ Collaboration diagram for ilPayMethods:

Public Member Functions

 __construct ($a_pm_id=0)
 
 setPmId ($a_pm_id)
 
 getPmId ()
 
 setPmTitle ($a_pm_title)
 
 getPmTitle ()
 
 setPmEnabled ($a_pm_enabled)
 
 getPmEnabled ()
 
 setSaveUserAddress ($a_save_usr_adr)
 
 getSaveUserAddress ()
 
 read ()
 
 readAll ()
 

Static Public Member Functions

static countPM ()
 
static _PMEnabled ($a_id)
 
static _PMdisable ($a_id)
 
static _PMenable ($a_id)
 
static _PMdisableAll ()
 
static _disableSaveUserAddress ($a_id)
 
static _enableSaveUserAddress ($a_id)
 
static _EnabledSaveUserAddress ($a_id)
 
static _getIdByTitle ($a_pm_title)
 
static _getTitleById ($a_pm_id)
 
static getStringByPaymethod ($a_type)
 
static getPayMethodsOptions ($type=0)
 
static _getActivePaymethods ()
 

Data Fields

 $pm_id
 
 $pm_title
 
 $pm_enabled
 
 $save_usr_adr
 

Detailed Description

Class ilObjPaymentSettingsGUI.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:

Definition at line 13 of file class.ilPayMethods.php.

Constructor & Destructor Documentation

◆ __construct()

ilPayMethods::__construct (   $a_pm_id = 0)

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

22 {
23 global $ilDB;
24 $this->db = $ilDB;
25
26 if($a_pm_id != 0)
27 {
28 $this->pm_id = $a_pm_id;
29 $this->read();
30 }
31 else $this->readAll();
32 }
global $ilDB

References $ilDB, read(), and readAll().

+ Here is the call graph for this function:

Member Function Documentation

◆ _disableSaveUserAddress()

static ilPayMethods::_disableSaveUserAddress (   $a_id)
static

Definition at line 152 of file class.ilPayMethods.php.

153 {
154 global $ilDB;
155
156 $res = $ilDB->manipulateF('UPDATE payment_paymethods SET save_usr_adr = 0
157 WHERE pm_id = %s',
158 array('integer'), array($a_id));
159 }

References $ilDB, and $res.

Referenced by ilObjPaymentSettingsGUI\deleteAddressesForPaymethodsObject().

+ Here is the caller graph for this function:

◆ _EnabledSaveUserAddress()

static ilPayMethods::_EnabledSaveUserAddress (   $a_id)
static

Definition at line 170 of file class.ilPayMethods.php.

171 {
172 global $ilDB;
173
174 $res = $ilDB->queryF('SELECT save_usr_adr FROM payment_paymethods WHERE pm_id = %s',
175 array('integer'), array($a_id));
176
177 $row = $ilDB->fetchAssoc($res);
178
179 return (int)$row['save_usr_adr'];
180
181 }

References $ilDB, $res, and $row.

Referenced by ilPaymentBookings\add(), and ilObjPaymentSettingsGUI\saveCustomerObject().

+ Here is the caller graph for this function:

◆ _enableSaveUserAddress()

static ilPayMethods::_enableSaveUserAddress (   $a_id)
static

Definition at line 161 of file class.ilPayMethods.php.

162 {
163 global $ilDB;
164
165 $res = $ilDB->manipulateF('UPDATE payment_paymethods SET save_usr_adr = 1
166 WHERE pm_id = %s',
167 array('integer'), array($a_id));
168 }

References $ilDB, and $res.

Referenced by ilObjPaymentSettingsGUI\savePayMethodsObject().

+ Here is the caller graph for this function:

◆ _getActivePaymethods()

static ilPayMethods::_getActivePaymethods ( )
static

Definition at line 271 of file class.ilPayMethods.php.

272 {
273 global $ilDB;
274
275 $pm = array();
276
277 $res = $ilDB->queryf('SELECT * FROM payment_paymethods WHERE pm_enabled = %s',
278 array('integer'), array(1));
279
280 while($row = $ilDB->fetchAssoc($res))
281 {
282 $pm[] = $row;
283 }
284 return $pm;
285 }

References $ilDB, $res, and $row.

◆ _getIdByTitle()

static ilPayMethods::_getIdByTitle (   $a_pm_title)
static

Definition at line 182 of file class.ilPayMethods.php.

183 {
184 global $ilDB;
185
186 $res = $ilDB->queryF('SELECT pm_id FROM payment_paymethods WHERE pm_title = %s',
187 array('text'), array($a_pm_title));
188
189 $row = $ilDB->fetchAssoc($res);
190 return (int)$row['pm_id'];
191 }

References $ilDB, $res, and $row.

Referenced by ilPurchaseBillGUI\__construct(), ilPurchasePaypal\__construct(), ilPurchaseBMFGUI\ilPurchaseBMFGUI(), ilShopShoppingCartGUI\unlockBillObjectsInShoppingCart(), and ilShopShoppingCartGUI\unlockPAYPALObjectsInShoppingCart().

+ Here is the caller graph for this function:

◆ _getTitleById()

static ilPayMethods::_getTitleById (   $a_pm_id)
static

Definition at line 192 of file class.ilPayMethods.php.

193 {
194 global $ilDB;
195
196 $res = $ilDB->queryF('SELECT pm_title FROM payment_paymethods WHERE pm_id = %s',
197 array('integer'), array($a_pm_id));
198
199 $row = $ilDB->fetchAssoc($res);
200 return $row['pm_title'];
201
202 }

References $ilDB, $res, and $row.

◆ _PMdisable()

static ilPayMethods::_PMdisable (   $a_id)
static

Definition at line 125 of file class.ilPayMethods.php.

126 {
127 global $ilDB;
128
129 $res = $ilDB->manipulateF('UPDATE payment_paymethods SET pm_enabled = 0
130 WHERE pm_id = %s',
131 array('integer'), array($a_id));
132 }

References $ilDB, and $res.

Referenced by ilObjPaymentSettingsGUI\savePayMethodsObject().

+ Here is the caller graph for this function:

◆ _PMdisableAll()

static ilPayMethods::_PMdisableAll ( )
static

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

144 {
145 global $ilDB;
146
147 $res = $ilDB->manipulateF('UPDATE payment_paymethods SET pm_enabled = %s',
148 array('integer'), array('0'));
149 }

References $ilDB, and $res.

◆ _PMenable()

static ilPayMethods::_PMenable (   $a_id)
static

Definition at line 134 of file class.ilPayMethods.php.

135 {
136 global $ilDB;
137
138 $res = $ilDB->manipulateF('UPDATE payment_paymethods SET pm_enabled = 1
139 WHERE pm_id = %s',
140 array('integer'), array($a_id));
141 }

References $ilDB, and $res.

Referenced by ilObjPaymentSettingsGUI\savePayMethodsObject().

+ Here is the caller graph for this function:

◆ _PMEnabled()

static ilPayMethods::_PMEnabled (   $a_id)
static

Definition at line 112 of file class.ilPayMethods.php.

113 {
114 global $ilDB;
115
116 $res = $ilDB->queryF('SELECT pm_enabled FROM payment_paymethods WHERE pm_id = %s',
117 array('integer'), array($a_id));
118
119 $row = $ilDB->fetchAssoc($res);
120
121 return (int)$row['pm_enabled'];
122
123 }

References $ilDB, $res, and $row.

Referenced by ilObjPaymentSettingsGUI\editStatisticObject().

+ Here is the caller graph for this function:

◆ countPM()

static ilPayMethods::countPM ( )
static

Definition at line 71 of file class.ilPayMethods.php.

72 {
73 global $ilDB;
74
75 $res = $ilDB->query('SELECT count(pm_id) cnt FROM payment_paymethods');
76 $row = $ilDB->fetchAssoc($res);
77
78 return $row['cnt'];
79
80 }

References $ilDB, $res, and $row.

◆ getPayMethodsOptions()

static ilPayMethods::getPayMethodsOptions (   $type = 0)
static

Definition at line 244 of file class.ilPayMethods.php.

245 {
246 global $ilDB, $lng;
247
248 $res = $ilDB->query('SELECT * FROM payment_paymethods WHERE pm_enabled = 1');
249 $options = array();
250
251 //this is only for additional entries in SelectInputGUIs
252 switch($type)
253 {
254 case 'all':
255 $options['all'] = $lng->txt('pay_all');
256 break;
257 case 'not_specified':
258 $options[0] = $lng->txt('paya_pay_method_not_specified');
259 break;
260 //default: break;
261 }
262
263 while($row = $ilDB->fetchAssoc($res))
264 {
265 $options[$row['pm_id']] = ilPayMethods::getStringByPaymethod($row['pm_title']);
266 }
267
268 return $options;
269 }
static getStringByPaymethod($a_type)
global $lng
Definition: privfeed.php:40
if(!is_array($argv)) $options

References $ilDB, $lng, $options, $res, $row, and getStringByPaymethod().

Referenced by ilPaymentStatisticGUI\addCustomer(), ilObjPaymentSettingsGUI\editDetailsObject(), and ilPaymentStatisticGUI\showStatistics().

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

◆ getPmEnabled()

ilPayMethods::getPmEnabled ( )

Definition at line 57 of file class.ilPayMethods.php.

58 {
59 return $this->pm_enabled;
60 }

References $pm_enabled.

◆ getPmId()

ilPayMethods::getPmId ( )

Definition at line 39 of file class.ilPayMethods.php.

40 {
41 return $this->pm_id;
42 }

References $pm_id.

Referenced by read().

+ Here is the caller graph for this function:

◆ getPmTitle()

ilPayMethods::getPmTitle ( )

Definition at line 48 of file class.ilPayMethods.php.

49 {
50 return $this->pm_title;
51 }

References $pm_title.

◆ getSaveUserAddress()

ilPayMethods::getSaveUserAddress ( )

Definition at line 66 of file class.ilPayMethods.php.

67 {
69 }

References $save_usr_adr.

◆ getStringByPaymethod()

static ilPayMethods::getStringByPaymethod (   $a_type)
static

Definition at line 204 of file class.ilPayMethods.php.

205 {
206 global $lng;
207
208 switch($a_type)
209 {
210 case '1':
211 case 'pm_bill':
212 case 'bill':
213 case 'PAY_METHOD_BILL': return $lng->txt('pays_bill');
214 break;
215
216 case '2':
217 case 'pm_bmf':
218 case 'bmf':
219 case 'PAY_METHOD_BMF': return $lng->txt('pays_bmf');
220 break;
221
222 case '3':
223 case 'pm_paypal':
224 case 'paypal':
225 case 'PAY_METHOD_PAYPAL': return $lng->txt('pays_paypal');
226 break;
227
228 case '4':
229 case 'pm_epay':
230 case 'epay':
231 case 'PAY_METHOD_EPAY': return $lng->txt('pays_epay');
232 break;
233 case 'PAY_METHOD_NOT_SPECIFIED': return $lng->txt('paya_pay_method_not_specified');
234 break;
235 default:
236 return $lng->txt('paya_pay_method_not_specified');
237 break;
238 }
239 }

References $lng.

Referenced by ilPurchaseBaseGUI\__sendBill(), ilPaymentStatisticGUI\addStatisticWorksheet(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilShopBoughtObjectsGUI\createBill(), ilPaymentStatisticGUI\editStatistic(), ilObjPaymentSettingsGUI\editStatisticObject(), getPayMethodsOptions(), ilObjPaymentSettingsGUI\objectsObject(), ilObjPaymentSettingsGUI\payMethodsObject(), ilShopBoughtObjectsGUI\showItems(), ilShopShoppingCartGUI\showItemsTable(), ilPaymentStatisticGUI\showStatistics(), and ilObjPaymentSettingsGUI\statisticObject().

+ Here is the caller graph for this function:

◆ read()

ilPayMethods::read ( )

Definition at line 81 of file class.ilPayMethods.php.

82 {
83 $res = $this->db->queryF('SELECT * FROM payment_paymethods WHERE pm_id = %s',
84 array('integer'), array($this->getPmId()));
85
86
87 while($row = $this->db->fetchAssoc($res))
88 {
89 $this->setPmTitle($row['pm_title']);
90 $this->setPmEnabled($row['pm_enabled']);
91 $this->setSaveUserAddress($row['save_usr_adr']);
92 }
93 return true;
94 }
setPmTitle($a_pm_title)
setSaveUserAddress($a_save_usr_adr)
setPmEnabled($a_pm_enabled)

References $res, $row, getPmId(), setPmEnabled(), setPmTitle(), and setSaveUserAddress().

Referenced by __construct().

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

◆ readAll()

ilPayMethods::readAll ( )

Definition at line 96 of file class.ilPayMethods.php.

97 {
98 $res = $this->db->query('SELECT * FROM payment_paymethods');
99 $paymethods = array();
100 $counter = 0;
101 while($row = $this->db->fetchAssoc($res))
102 {
103 $paymethods[$counter]['pm_id'] = $row['pm_id'];
104 $paymethods[$counter]['pm_title'] = $row['pm_title'];
105 $paymethods[$counter]['pm_enabled'] = $row['pm_enabled'];
106 $paymethods[$counter]['save_usr_adr'] = $row['save_usr_adr'];
107 $counter++;
108 }
109 return $paymethods;
110 }

References $res, and $row.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPmEnabled()

ilPayMethods::setPmEnabled (   $a_pm_enabled)

Definition at line 53 of file class.ilPayMethods.php.

54 {
55 $this->pm_enabled = $a_pm_enabled;
56 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPmId()

ilPayMethods::setPmId (   $a_pm_id)

Definition at line 35 of file class.ilPayMethods.php.

36 {
37 $this->pm_id = $a_pm_id;
38 }

◆ setPmTitle()

ilPayMethods::setPmTitle (   $a_pm_title)

Definition at line 44 of file class.ilPayMethods.php.

45 {
46 $this->pm_title = $a_pm_title;
47 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setSaveUserAddress()

ilPayMethods::setSaveUserAddress (   $a_save_usr_adr)

Definition at line 62 of file class.ilPayMethods.php.

63 {
64 $this->save_usr_adr = $a_save_usr_adr;
65 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $pm_enabled

ilPayMethods::$pm_enabled

Definition at line 17 of file class.ilPayMethods.php.

Referenced by getPmEnabled().

◆ $pm_id

ilPayMethods::$pm_id

Definition at line 15 of file class.ilPayMethods.php.

Referenced by getPmId().

◆ $pm_title

ilPayMethods::$pm_title

Definition at line 16 of file class.ilPayMethods.php.

Referenced by getPmTitle().

◆ $save_usr_adr

ilPayMethods::$save_usr_adr

Definition at line 18 of file class.ilPayMethods.php.

Referenced by getSaveUserAddress().


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