52 $this->PERM_STATISTIC = 1;
53 $this->PERM_OBJECT = 2;
60 return $this->trustees ? $this->trustees : array();
64 return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
68 return isset($this->trustees[$a_usr_id]);
73 $this->perm_stat = (bool) $a_on;
77 $this->perm_obj = (bool) $a_on;
81 $this->perm_coupons = (bool) $a_on;
85 $this->trustee_id = $a_id;
90 $statement = $this->db->manipulateF(
'
91 INSERT INTO payment_trustees
98 VALUES (%s,%s,%s,%s,%s)',
99 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
100 array( $this->user_obj->getId(),
116 die(
"ilPaymentTrustees::modify() no id given");
119 $statement = $this->db->manipulateF(
'
120 UPDATE payment_trustees
126 AND trustee_id = %s',
127 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
132 $this->user_obj->getId(),
145 die(
"ilPaymentTrustees::delete() no id given");
148 $statement = $this->db->manipulateF(
'
149 DELETE FROM payment_trustees
151 AND trustee_id = %s ',
152 array(
'integer',
'integer'),
162 $statement = $this->db->manipulateF(
'
163 DELETE FROM payment_trustees
164 WHERE vendor_id = %s',
166 array($this->user_obj->getId()));
177 return $this->trustee_id;
181 return (
int) $this->perm_stat;
185 return (
int) $this->perm_obj;
189 return (
int) $this->perm_coupons;
194 $this->trustees = array();
196 $res = $this->db->queryf(
'
197 SELECT * FROM payment_trustees
198 WHERE vendor_id = %s',
200 array($this->user_obj->getId()));
202 while(
$row = $this->db->fetchObject(
$res))
204 $this->trustees[
$row->trustee_id][
'trustee_id'] =
$row->trustee_id;
205 $this->trustees[
$row->trustee_id][
'perm_stat'] =
$row->perm_stat;
206 $this->trustees[
$row->trustee_id][
'perm_obj'] =
$row->perm_obj;
207 $this->trustees[
$row->trustee_id][
'perm_coupons'] =
$row->perm_coupons;
216 $statement = $ilDB->manipulateF(
'
217 DELETE FROM payment_trustees
218 WHERE vendor_id = %s',
219 array(
'integer'), array($a_vendor_id));
228 $res = $ilDB->queryf(
'
229 SELECT * FROM payment_trustees
230 WHERE trustee_id = %s',
231 array(
'integer'), array($a_trustee));
233 while(
$row = $ilDB->fetchObject(
$res))
235 if((
bool)
$row->perm_stat)
247 $res = $ilDB->queryf(
'
248 SELECT * FROM payment_trustees
249 WHERE trustee_id = %s',
253 while(
$row = $ilDB->fetchObject(
$res))
255 if((
bool)
$row->perm_obj)
267 $res = $ilDB->queryf(
'
268 SELECT * FROM payment_trustees
269 WHERE trustee_id = %s',
273 while(
$row = $ilDB->fetchObject(
$res))
275 if((
bool)
$row->perm_coupons)
287 $res = $ilDB->queryf(
'
288 SELECT * FROM payment_trustees
289 WHERE trustee_id = %s
292 array(
'integer',
'integer',
'integer' ),
293 array($a_trustee, $a_vendor,
'1'));
295 return $res->numRows() ?
true :
false;
302 $res = $ilDB->queryf(
'
303 SELECT * FROM payment_trustees
304 WHERE trustee_id = %s
307 array(
'integer',
'integer',
'integer' ),
308 array($a_trustee, $a_vendor,
'1'));
310 return $res->numRows() ?
true :
false;
317 $res = $ilDB->queryf(
'
318 SELECT * FROM payment_trustees
319 WHERE trustee_id = %s
321 AND perm_coupons = %s',
322 array(
'integer',
'integer',
'integer' ),
323 array($a_trustee, $a_vendor,
'1'));
325 return $res->numRows() ?
true :
false;
339 $res = $ilDB->queryf(
'
340 SELECT vendor_id FROM payment_trustees
341 WHERE trustee_id = %s
343 array(
'integer',
'integer'),
344 array($a_usr_id,
'1'));
346 while(
$row = $ilDB->fetchObject(
$res))
348 $vendors[] =
$row->vendor_id;
351 return $vendors ? $vendors : array();
358 $res = $ilDB->queryf(
'
359 SELECT vendor_id FROM payment_trustees
360 WHERE trustee_id = %s
361 AND perm_coupons = %s ',
362 array(
'integer',
'integer'),
363 array($a_usr_id,
'1'));
365 while(
$row = $ilDB->fetchObject(
$res))
367 $vendors[] =
$row->vendor_id;
370 return $vendors ? $vendors : array();
377 $res = $ilDB->queryf(
'
378 SELECT trustee_id FROM payment_trustees
380 AND perm_coupons = %s ',
381 array(
'integer',
'integer'), array($a_usr_id,
'1'));
383 while(
$row = $ilDB->fetchObject(
$res))