ILIAS  release_4-4 Revision
ilPaymentVendors Class Reference
+ Collaboration diagram for ilPaymentVendors:

Public Member Functions

 getVendors ()
 
 isAssigned ($a_usr_id)
 
 add ($a_usr_id)
 
 update ($a_usr_id, $a_cost_center)
 
 delete ($a_usr_id)
 

Static Public Member Functions

static getInstance ()
 

Data Fields

 $db = null
 
 $vendors = array()
 

Private Member Functions

 __construct ()
 Constructor private. More...
 
 __read ()
 

Static Private Attributes

static $_instance
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilPaymentVendors::__construct ( )
private

Constructor private.

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

References __read().

40  {
41  global $ilDB;
42 
43  $this->db = $ilDB;
44 
45  $this->__read();
46  }
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilPaymentVendors::__read ( )
private

Definition at line 107 of file class.ilPaymentVendors.php.

References $res, and $row.

Referenced by __construct(), add(), delete(), and update().

108  {
109  $this->vendors = array();
110 
111  $res = $this->db->query('SELECT * FROM payment_vendors');
112 
113 
114  while($row = $this->db->fetchObject($res))
115  {
116  $this->vendors[$row->vendor_id]['vendor_id'] = $row->vendor_id;
117  $this->vendors[$row->vendor_id]['cost_center'] = $row->cost_center;
118  }
119  return true;
120  }
+ Here is the caller graph for this function:

◆ add()

ilPaymentVendors::add (   $a_usr_id)

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

References __read().

59  {
60  if(isset($this->vendors[$a_usr_id]))
61  {
62  die("class.ilPaymentVendors::add() Vendor already exists");
63  }
64 
65  $this->db->insert('payment_vendors',
66  array(
67  'vendor_id' => array('integer', $a_usr_id),
68  'cost_center' => array('text', 'IL_INST_ID_' . $a_usr_id)
69  ));
70 
71  $this->__read();
72 
73  return true;
74  }
+ Here is the call graph for this function:

◆ delete()

ilPaymentVendors::delete (   $a_usr_id)

Definition at line 87 of file class.ilPaymentVendors.php.

References __read().

88  {
89  if(!isset($this->vendors[$a_usr_id]))
90  {
91  die("class.ilPaymentVendors::delete() Vendor does not exist");
92  }
93 
94  $this->db->manipulateF('
95  DELETE FROM payment_vendors WHERE vendor_id = %s',
96  array('integer'),
97  array($a_usr_id));
98 
99  // deleting of trustees is done by gui as a next step
100 
101  $this->__read();
102 
103  return true;
104  }
+ Here is the call graph for this function:

◆ getInstance()

static ilPaymentVendors::getInstance ( )
static

Definition at line 25 of file class.ilPaymentVendors.php.

Referenced by ilObjPaymentSettingsGUI\__construct().

26  {
27  if(!isset(self::$_instance))
28  {
29  self::$_instance = new ilPaymentVendors();
30  }
31 
32  return self::$_instance;
33  }
+ Here is the caller graph for this function:

◆ getVendors()

ilPaymentVendors::getVendors ( )

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

References $vendors.

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

◆ isAssigned()

ilPaymentVendors::isAssigned (   $a_usr_id)

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

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

◆ update()

ilPaymentVendors::update (   $a_usr_id,
  $a_cost_center 
)

Definition at line 76 of file class.ilPaymentVendors.php.

References __read().

77  {
78  $this->db->update('payment_vendors',
79  array('cost_center' => array('text', $a_cost_center)),
80  array('vendor_id' => array('integer', $a_usr_id)));
81 
82  $this->__read();
83 
84  return true;
85  }
+ Here is the call graph for this function:

Field Documentation

◆ $_instance

ilPaymentVendors::$_instance
staticprivate

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

◆ $db

ilPaymentVendors::$db = null

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

◆ $vendors

ilPaymentVendors::$vendors = array()

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

Referenced by getVendors().


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