39 $this->PERM_STATISTIC = 1;
40 $this->PERM_OBJECT = 2;
47 return $this->trustees ? $this->trustees : array();
51 return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
55 return isset($this->trustees[$a_usr_id]);
60 $this->perm_stat = (bool) $a_on;
64 $this->perm_obj = (bool) $a_on;
68 $this->perm_coupons = (bool) $a_on;
72 $this->trustee_id = $a_id;
77 $statement = $this->db->manipulateF(
'
78 INSERT INTO payment_trustees
85 VALUES (%s,%s,%s,%s,%s)',
86 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
87 array( $this->user_obj->getId(),
103 die(
"ilPaymentTrustees::modify() no id given");
106 $statement = $this->db->manipulateF(
'
107 UPDATE payment_trustees
113 AND trustee_id = %s',
114 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
119 $this->user_obj->getId(),
128 public function delete()
132 die(
"ilPaymentTrustees::delete() no id given");
135 $statement = $this->db->manipulateF(
'
136 DELETE FROM payment_trustees
138 AND trustee_id = %s ',
139 array(
'integer',
'integer'),
149 $statement = $this->db->manipulateF(
'
150 DELETE FROM payment_trustees
151 WHERE vendor_id = %s',
153 array($this->user_obj->getId()));
181 $this->trustees = array();
183 $res = $this->db->queryf(
'
184 SELECT * FROM payment_trustees
185 WHERE vendor_id = %s',
187 array($this->user_obj->getId()));
189 while(
$row = $this->db->fetchObject(
$res))
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;
203 $statement = $ilDB->manipulateF(
'
204 DELETE FROM payment_trustees
205 WHERE vendor_id = %s',
206 array(
'integer'), array($a_vendor_id));
215 $res = $ilDB->queryf(
'
216 SELECT * FROM payment_trustees
217 WHERE trustee_id = %s',
218 array(
'integer'), array($a_trustee));
220 while(
$row = $ilDB->fetchObject(
$res))
222 if((
bool)
$row->perm_stat)
234 $res = $ilDB->queryf(
'
235 SELECT * FROM payment_trustees
236 WHERE trustee_id = %s',
240 while(
$row = $ilDB->fetchObject(
$res))
242 if((
bool)
$row->perm_obj)
254 $res = $ilDB->queryf(
'
255 SELECT * FROM payment_trustees
256 WHERE trustee_id = %s',
260 while(
$row = $ilDB->fetchObject(
$res))
262 if((
bool)
$row->perm_coupons)
274 $res = $ilDB->queryf(
'
275 SELECT * FROM payment_trustees
276 WHERE trustee_id = %s
279 array(
'integer',
'integer',
'integer' ),
280 array($a_trustee, $a_vendor,
'1'));
282 return $res->numRows() ?
true :
false;
289 $res = $ilDB->queryf(
'
290 SELECT * FROM payment_trustees
291 WHERE trustee_id = %s
294 array(
'integer',
'integer',
'integer' ),
295 array($a_trustee, $a_vendor,
'1'));
297 return $ilDB->numRows(
$res) ?
true :
false;
304 $res = $ilDB->queryf(
'
305 SELECT * FROM payment_trustees
306 WHERE trustee_id = %s
308 AND perm_coupons = %s',
309 array(
'integer',
'integer',
'integer' ),
310 array($a_trustee, $a_vendor,
'1'));
312 return $res->numRows() ?
true :
false;
326 $res = $ilDB->queryf(
'
327 SELECT vendor_id FROM payment_trustees
328 WHERE trustee_id = %s
330 array(
'integer',
'integer'),
331 array($a_usr_id,
'1'));
333 while(
$row = $ilDB->fetchObject(
$res))
335 $vendors[] =
$row->vendor_id;
338 return $vendors ? $vendors : array();
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'));
352 while(
$row = $ilDB->fetchObject(
$res))
354 $vendors[] =
$row->vendor_id;
357 return $vendors ? $vendors : array();
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'));
371 while(
$row = $ilDB->fetchObject(
$res))
373 $vendors[] =
$row->vendor_id;
376 return $vendors ? $vendors : array();
383 $res = $ilDB->queryf(
'
384 SELECT trustee_id FROM payment_trustees
386 AND perm_coupons = %s ',
387 array(
'integer',
'integer'), array($a_usr_id,
'1'));
389 while(
$row = $ilDB->fetchObject(
$res))
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))
405 $vendors[] =
$row->vendor_id;
407 return $vendors ? $vendors : array();