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

Public Member Functions

 __construct ($user_obj)
 Constructor @access public. More...
 
 getTrustees ()
 
 getTrustee ($a_usr_id)
 
 isTrustee ($a_usr_id)
 
 toggleStatisticPermission ($a_on)
 
 toggleObjectPermission ($a_on)
 
 toggleCouponsPermission ($a_on)
 
 setTrusteeId ($a_id)
 
 add ()
 
 modify ()
 
 delete ()
 
 deleteAll ()
 

Static Public Member Functions

static _deleteTrusteesOfVendor ($a_vendor_id)
 
static _hasStatisticPermission ($a_trustee)
 
static _hasObjectPermission ($a_trustee)
 
static _hasCouponsPermission ($a_trustee)
 
static _hasStatisticPermissionByVendor ($a_trustee, $a_vendor)
 
static _hasObjectPermissionByVendor ($a_trustee, $a_vendor)
 
static _hasCouponsPermissionByVendor ($a_trustee, $a_vendor)
 
static _hasAccess ($a_usr_id)
 
static _getVendorsForObjects ($a_usr_id)
 
static _getVendorsForStatisticsByTrusteeId ($a_trustee_id)
 
static _getVendorsForCouponsByTrusteeId ($a_usr_id)
 
static _getTrusteesForCouponsByVendorId ($a_usr_id)
 
static _getVendorIdsByTrustee ($a_usr_id)
 

Data Fields

 $db = null
 
 $user_obj
 
 $trustees = array()
 
 $perm_stat = null
 
 $perm_obj = null
 
 $perm_coupons = null
 
 $trustee_id = 0
 

Private Member Functions

 __getTrusteeId ()
 
 __getStatisticPermissionStatus ()
 
 __getObjectPermissisonStatus ()
 
 __getCouponsPermissisonStatus ()
 
 __read ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilPaymentTrustees::__construct (   $user_obj)

Constructor @access public.

Definition at line 32 of file class.ilPaymentTrustees.php.

33 {
34 global $ilDB;
35
36 $this->db = $ilDB;
37 $this->user_obj = $user_obj;
38
39 $this->PERM_STATISTIC = 1;
40 $this->PERM_OBJECT = 2;
41
42 $this->__read();
43 }
global $ilDB

References $ilDB, $user_obj, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __getCouponsPermissisonStatus()

ilPaymentTrustees::__getCouponsPermissisonStatus ( )
private

Definition at line 174 of file class.ilPaymentTrustees.php.

175 {
176 return (int) $this->perm_coupons;
177 }

References $perm_coupons.

Referenced by modify().

+ Here is the caller graph for this function:

◆ __getObjectPermissisonStatus()

ilPaymentTrustees::__getObjectPermissisonStatus ( )
private

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

171 {
172 return (int) $this->perm_obj;
173 }

References $perm_obj.

Referenced by modify().

+ Here is the caller graph for this function:

◆ __getStatisticPermissionStatus()

ilPaymentTrustees::__getStatisticPermissionStatus ( )
private

Definition at line 166 of file class.ilPaymentTrustees.php.

167 {
168 return (int) $this->perm_stat;
169 }

References $perm_stat.

Referenced by modify().

+ Here is the caller graph for this function:

◆ __getTrusteeId()

ilPaymentTrustees::__getTrusteeId ( )
private

Definition at line 162 of file class.ilPaymentTrustees.php.

References $trustee_id.

Referenced by delete(), and modify().

+ Here is the caller graph for this function:

◆ __read()

ilPaymentTrustees::__read ( )
private

Definition at line 178 of file class.ilPaymentTrustees.php.

179 {
180
181 $this->trustees = array();
182
183 $res = $this->db->queryf('
184 SELECT * FROM payment_trustees
185 WHERE vendor_id = %s',
186 array('integer'),
187 array($this->user_obj->getId()));
188
189 while($row = $this->db->fetchObject($res))
190 {
191 $this->trustees[$row->trustee_id]['trustee_id'] = $row->trustee_id;
192 $this->trustees[$row->trustee_id]['perm_stat'] = $row->perm_stat;
193 $this->trustees[$row->trustee_id]['perm_obj'] = $row->perm_obj;
194 $this->trustees[$row->trustee_id]['perm_coupons'] = $row->perm_coupons;
195 }
196 }

References $res, and $row.

Referenced by __construct(), add(), delete(), deleteAll(), and modify().

+ Here is the caller graph for this function:

◆ _deleteTrusteesOfVendor()

static ilPaymentTrustees::_deleteTrusteesOfVendor (   $a_vendor_id)
static

Definition at line 199 of file class.ilPaymentTrustees.php.

200 {
201 global $ilDB;
202
203 $statement = $ilDB->manipulateF('
204 DELETE FROM payment_trustees
205 WHERE vendor_id = %s',
206 array('integer'), array($a_vendor_id));
207
208 return true;
209 }

References $ilDB.

Referenced by ilObjPaymentSettingsGUI\performDeleteVendorsObject().

+ Here is the caller graph for this function:

◆ _getTrusteesForCouponsByVendorId()

static ilPaymentTrustees::_getTrusteesForCouponsByVendorId (   $a_usr_id)
static

Definition at line 379 of file class.ilPaymentTrustees.php.

380 {
381 global $ilDB;
382
383 $res = $ilDB->queryf('
384 SELECT trustee_id FROM payment_trustees
385 WHERE vendor_id = %s
386 AND perm_coupons = %s ',
387 array('integer', 'integer'), array($a_usr_id, '1'));
388
389 while($row = $ilDB->fetchObject($res))
390 {
391 $trustees[] = $row->trustee_id;
392 }
393
394 return $trustees ? $trustees : array();
395 }

References $ilDB, $res, $row, and $trustees.

Referenced by ilPaymentCoupons\getVendorIds().

+ Here is the caller graph for this function:

◆ _getVendorIdsByTrustee()

static ilPaymentTrustees::_getVendorIdsByTrustee (   $a_usr_id)
static

Definition at line 396 of file class.ilPaymentTrustees.php.

397 {
398 global $ilDB;
399
400 $res = $ilDB->queryf('
401 SELECT vendor_id FROM payment_trustees WHERE trustee_id = %s',
402 array('integer'), array($a_usr_id));
403 while($row = $ilDB->fetchObject($res))
404 {
405 $vendors[] = $row->vendor_id;
406 }
407 return $vendors ? $vendors : array();
408 }

References $ilDB, $res, and $row.

Referenced by ilPaymentObject\_hasAccess().

+ Here is the caller graph for this function:

◆ _getVendorsForCouponsByTrusteeId()

static ilPaymentTrustees::_getVendorsForCouponsByTrusteeId (   $a_usr_id)
static

Definition at line 360 of file class.ilPaymentTrustees.php.

361 {
362 global $ilDB;
363
364 $res = $ilDB->queryf('
365 SELECT vendor_id FROM payment_trustees
366 WHERE trustee_id = %s
367 AND perm_coupons = %s ',
368 array('integer', 'integer'),
369 array($a_usr_id, '1'));
370
371 while($row = $ilDB->fetchObject($res))
372 {
373 $vendors[] = $row->vendor_id;
374 }
375
376 return $vendors ? $vendors : array();
377 }

References $ilDB, $res, and $row.

Referenced by ilPaymentCoupons\getVendorIds().

+ Here is the caller graph for this function:

◆ _getVendorsForObjects()

static ilPaymentTrustees::_getVendorsForObjects (   $a_usr_id)
static

Definition at line 322 of file class.ilPaymentTrustees.php.

323 {
324 global $ilDB;
325
326 $res = $ilDB->queryf('
327 SELECT vendor_id FROM payment_trustees
328 WHERE trustee_id = %s
329 AND perm_obj = %s ',
330 array('integer', 'integer'),
331 array($a_usr_id, '1'));
332
333 while($row = $ilDB->fetchObject($res))
334 {
335 $vendors[] = $row->vendor_id;
336 }
337
338 return $vendors ? $vendors : array();
339 }

References $ilDB, $res, and $row.

Referenced by ilPaymentObject\_getObjectsData(), and ilPaymentObject\_isPurchasable().

+ Here is the caller graph for this function:

◆ _getVendorsForStatisticsByTrusteeId()

static ilPaymentTrustees::_getVendorsForStatisticsByTrusteeId (   $a_trustee_id)
static

Definition at line 341 of file class.ilPaymentTrustees.php.

342 {
343 global $ilDB;
344
345 $res = $ilDB->queryf('
346 SELECT vendor_id FROM payment_trustees
347 WHERE trustee_id = %s
348 AND perm_stat = %s ',
349 array('integer', 'integer'),
350 array($a_trustee_id, '1'));
351
352 while($row = $ilDB->fetchObject($res))
353 {
354 $vendors[] = $row->vendor_id;
355 }
356
357 return $vendors ? $vendors : array();
358 }

References $ilDB, $res, and $row.

Referenced by ilPaymentBookings\__getVendorIds().

+ Here is the caller graph for this function:

◆ _hasAccess()

static ilPaymentTrustees::_hasAccess (   $a_usr_id)
static

Definition at line 315 of file class.ilPaymentTrustees.php.

316 {
320 }
static _hasCouponsPermission($a_trustee)
static _hasStatisticPermission($a_trustee)
static _hasObjectPermission($a_trustee)

References _hasCouponsPermission(), _hasObjectPermission(), and _hasStatisticPermission().

Referenced by ilShopController\buildTabs().

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

◆ _hasCouponsPermission()

static ilPaymentTrustees::_hasCouponsPermission (   $a_trustee)
static

Definition at line 250 of file class.ilPaymentTrustees.php.

251 {
252 global $ilDB;
253
254 $res = $ilDB->queryf('
255 SELECT * FROM payment_trustees
256 WHERE trustee_id = %s',
257 array('integer'),
258 array($a_trustee));
259
260 while($row = $ilDB->fetchObject($res))
261 {
262 if((bool) $row->perm_coupons)
263 {
264 return true;
265 }
266 }
267 return false;
268 }

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilPaymentAdminGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

+ Here is the caller graph for this function:

◆ _hasCouponsPermissionByVendor()

static ilPaymentTrustees::_hasCouponsPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 300 of file class.ilPaymentTrustees.php.

301 {
302 global $ilDB;
303
304 $res = $ilDB->queryf('
305 SELECT * FROM payment_trustees
306 WHERE trustee_id = %s
307 AND vendor_id = %s
308 AND perm_coupons = %s',
309 array('integer', 'integer', 'integer' ),
310 array($a_trustee, $a_vendor, '1'));
311
312 return $res->numRows() ? true : false;
313 }

References $ilDB, and $res.

◆ _hasObjectPermission()

static ilPaymentTrustees::_hasObjectPermission (   $a_trustee)
static

Definition at line 230 of file class.ilPaymentTrustees.php.

231 {
232 global $ilDB;
233
234 $res = $ilDB->queryf('
235 SELECT * FROM payment_trustees
236 WHERE trustee_id = %s',
237 array('integer'),
238 array($a_trustee));
239
240 while($row = $ilDB->fetchObject($res))
241 {
242 if((bool) $row->perm_obj)
243 {
244 return true;
245 }
246 }
247 return false;
248 }

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilPaymentAdminGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

+ Here is the caller graph for this function:

◆ _hasObjectPermissionByVendor()

static ilPaymentTrustees::_hasObjectPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 285 of file class.ilPaymentTrustees.php.

286 {
287 global $ilDB;
288
289 $res = $ilDB->queryf('
290 SELECT * FROM payment_trustees
291 WHERE trustee_id = %s
292 AND vendor_id = %s
293 AND perm_obj = %s',
294 array('integer', 'integer', 'integer' ),
295 array($a_trustee, $a_vendor, '1'));
296
297 return $ilDB->numRows($res) ? true : false;
298 }

References $ilDB, and $res.

◆ _hasStatisticPermission()

static ilPaymentTrustees::_hasStatisticPermission (   $a_trustee)
static

Definition at line 211 of file class.ilPaymentTrustees.php.

212 {
213 global $ilDB;
214
215 $res = $ilDB->queryf('
216 SELECT * FROM payment_trustees
217 WHERE trustee_id = %s',
218 array('integer'), array($a_trustee));
219
220 while($row = $ilDB->fetchObject($res))
221 {
222 if((bool) $row->perm_stat)
223 {
224 return true;
225 }
226 }
227 return false;
228 }

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilPaymentAdminGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

+ Here is the caller graph for this function:

◆ _hasStatisticPermissionByVendor()

static ilPaymentTrustees::_hasStatisticPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 270 of file class.ilPaymentTrustees.php.

271 {
272 global $ilDB;
273
274 $res = $ilDB->queryf('
275 SELECT * FROM payment_trustees
276 WHERE trustee_id = %s
277 AND vendor_id = %s
278 AND perm_stat = %s',
279 array('integer', 'integer', 'integer' ),
280 array($a_trustee, $a_vendor, '1'));
281
282 return $res->numRows() ? true : false;
283 }

References $ilDB, and $res.

Referenced by ilPaymentBookings\__getVendorIds().

+ Here is the caller graph for this function:

◆ add()

ilPaymentTrustees::add ( )

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

76 {
77 $statement = $this->db->manipulateF('
78 INSERT INTO payment_trustees
79 ( vendor_id,
80 trustee_id,
81 perm_stat,
82 perm_coupons,
83 perm_obj
84 )
85 VALUES (%s,%s,%s,%s,%s)',
86 array('integer', 'integer', 'integer', 'integer', 'integer'),
87 array( $this->user_obj->getId(),
88 $this->__getTrusteeId(),
89 $this->__getStatisticPermissionStatus(),
90 $this->__getCouponsPermissisonStatus(),
91 $this->__getObjectPermissisonStatus()
92 ));
93
94
95 $this->__read();
96
97 return true;
98 }

References __read().

+ Here is the call graph for this function:

◆ delete()

ilPaymentTrustees::delete ( )

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

129 {
130 if(!$this->__getTrusteeId())
131 {
132 die("ilPaymentTrustees::delete() no id given");
133 }
134
135 $statement = $this->db->manipulateF('
136 DELETE FROM payment_trustees
137 WHERE vendor_id = %s
138 AND trustee_id = %s ',
139 array('integer', 'integer'),
140 array($this->user_obj->getId(), $this->__getTrusteeId()));
141
142 $this->__read();
143
144 return true;
145 }

References __getTrusteeId(), and __read().

+ Here is the call graph for this function:

◆ deleteAll()

ilPaymentTrustees::deleteAll ( )

Definition at line 147 of file class.ilPaymentTrustees.php.

148 {
149 $statement = $this->db->manipulateF('
150 DELETE FROM payment_trustees
151 WHERE vendor_id = %s',
152 array('integer'),
153 array($this->user_obj->getId()));
154
155 $this->__read();
156
157 return true;
158 }

References __read().

+ Here is the call graph for this function:

◆ getTrustee()

ilPaymentTrustees::getTrustee (   $a_usr_id)

Definition at line 49 of file class.ilPaymentTrustees.php.

50 {
51 return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
52 }

◆ getTrustees()

ilPaymentTrustees::getTrustees ( )

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

46 {
47 return $this->trustees ? $this->trustees : array();
48 }

◆ isTrustee()

ilPaymentTrustees::isTrustee (   $a_usr_id)

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

54 {
55 return isset($this->trustees[$a_usr_id]);
56 }

◆ modify()

ilPaymentTrustees::modify ( )

Definition at line 99 of file class.ilPaymentTrustees.php.

100 {
101 if(!$this->__getTrusteeId())
102 {
103 die("ilPaymentTrustees::modify() no id given");
104 }
105
106 $statement = $this->db->manipulateF('
107 UPDATE payment_trustees
108 SET trustee_id = %s,
109 perm_stat = %s,
110 perm_obj = %s,
111 perm_coupons = %s
112 WHERE vendor_id = %s
113 AND trustee_id = %s',
114 array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'),
115 array( $this->__getTrusteeId(),
119 $this->user_obj->getId(),
120 $this->__getTrusteeId()
121 ));
122
123
124 $this->__read();
125
126 return true;
127 }

References __getCouponsPermissisonStatus(), __getObjectPermissisonStatus(), __getStatisticPermissionStatus(), __getTrusteeId(), and __read().

+ Here is the call graph for this function:

◆ setTrusteeId()

ilPaymentTrustees::setTrusteeId (   $a_id)

Definition at line 70 of file class.ilPaymentTrustees.php.

71 {
72 $this->trustee_id = $a_id;
73 }

◆ toggleCouponsPermission()

ilPaymentTrustees::toggleCouponsPermission (   $a_on)

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

67 {
68 $this->perm_coupons = (bool) $a_on;
69 }

◆ toggleObjectPermission()

ilPaymentTrustees::toggleObjectPermission (   $a_on)

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

63 {
64 $this->perm_obj = (bool) $a_on;
65 }

◆ toggleStatisticPermission()

ilPaymentTrustees::toggleStatisticPermission (   $a_on)

Definition at line 58 of file class.ilPaymentTrustees.php.

59 {
60 $this->perm_stat = (bool) $a_on;
61 }

Field Documentation

◆ $db

ilPaymentTrustees::$db = null

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

◆ $perm_coupons

ilPaymentTrustees::$perm_coupons = null

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

Referenced by __getCouponsPermissisonStatus().

◆ $perm_obj

ilPaymentTrustees::$perm_obj = null

Definition at line 23 of file class.ilPaymentTrustees.php.

Referenced by __getObjectPermissisonStatus().

◆ $perm_stat

ilPaymentTrustees::$perm_stat = null

Definition at line 22 of file class.ilPaymentTrustees.php.

Referenced by __getStatisticPermissionStatus().

◆ $trustee_id

ilPaymentTrustees::$trustee_id = 0

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

Referenced by __getTrusteeId().

◆ $trustees

ilPaymentTrustees::$trustees = array()

Definition at line 20 of file class.ilPaymentTrustees.php.

Referenced by _getTrusteesForCouponsByVendorId().

◆ $user_obj

ilPaymentTrustees::$user_obj

Definition at line 19 of file class.ilPaymentTrustees.php.

Referenced by __construct().


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