41 return isset($this->vendors[$a_usr_id]);
44 function add($a_usr_id)
46 if(isset($this->vendors[$a_usr_id]))
48 die(
"class.ilPaymentVendors::add() Vendor already exists");
51 $statement = $this->db->manipulateF(
'
52 INSERT INTO payment_vendors
56 array(
'integer',
'text'),
57 array($a_usr_id,
'IL_INST_ID_'.$a_usr_id));
63 function update($a_usr_id, $a_cost_center)
65 $statement = $this->db->manipulateF(
'
66 UPDATE payment_vendors
68 WHERE vendor_id = %s',
69 array(
'text',
'integer'),
70 array($a_cost_center, $a_usr_id));
76 function delete($a_usr_id)
78 if(!isset($this->vendors[$a_usr_id]))
80 die(
"class.ilPaymentVendors::delete() Vendor does not exist");
83 $statement = $this->db->manipulateF(
'
84 DELETE FROM payment_vendors WHERE vendor_id = %s',
96 $this->vendors = array();
98 $res = $this->db->query(
'SELECT * FROM payment_vendors');
101 while(
$row = $this->db->fetchObject(
$res))
103 $this->vendors[
$row->vendor_id][
'vendor_id'] =
$row->vendor_id;
104 $this->vendors[
$row->vendor_id][
'cost_center'] =
$row->cost_center;
114 $res = $ilDB->queryf(
'
115 SELECT * FROM payment_vendors WHERE vendor_id = %s',
116 array(
'integer'), array($a_usr_id));
118 return $res->numRows() ?
true :
false;
125 $res = $ilDB->queryf(
'
126 SELECT * FROM payment_vendors WHERE vendor_id = %s',
127 array(
'integer'),array($a_usr_id));
129 while(
$row = $ilDB->fetchObject(
$res))
131 return $row->cost_center;