ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 __read ()

Static Private Attributes

static $_instance

Detailed Description

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

Constructor & Destructor Documentation

ilPaymentVendors::__construct ( )
private

Constructor private.

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

References $ilDB, and __read().

{
global $ilDB;
$this->db = $ilDB;
$this->__read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilPaymentVendors::__read ( )
private

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

References $res, and $row.

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

{
$this->vendors = array();
$res = $this->db->query('SELECT * FROM payment_vendors');
while($row = $this->db->fetchObject($res))
{
$this->vendors[$row->vendor_id]['vendor_id'] = $row->vendor_id;
$this->vendors[$row->vendor_id]['cost_center'] = $row->cost_center;
}
return true;
}

+ Here is the caller graph for this function:

ilPaymentVendors::add (   $a_usr_id)

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

References __read().

{
if(isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::add() Vendor already exists");
}
$this->db->insert('payment_vendors',
array(
'vendor_id' => array('integer', $a_usr_id),
'cost_center' => array('text', 'IL_INST_ID_' . $a_usr_id)
));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentVendors::delete (   $a_usr_id)

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

References __read().

{
if(!isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::delete() Vendor does not exist");
}
$this->db->manipulateF('
DELETE FROM payment_vendors WHERE vendor_id = %s',
array('integer'),
array($a_usr_id));
// deleting of trustees is done by gui as a next step
$this->__read();
return true;
}

+ Here is the call graph for this function:

static ilPaymentVendors::getInstance ( )
static

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

References $_instance.

Referenced by ilObjPaymentSettingsGUI\__construct().

{
if(!isset(self::$_instance))
{
self::$_instance = new ilPaymentVendors();
}
}

+ Here is the caller graph for this function:

ilPaymentVendors::getVendors ( )

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

References $vendors.

{
}
ilPaymentVendors::isAssigned (   $a_usr_id)

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

{
return isset($this->vendors[$a_usr_id]);
}
ilPaymentVendors::update (   $a_usr_id,
  $a_cost_center 
)

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

References __read().

{
$this->db->update('payment_vendors',
array('cost_center' => array('text', $a_cost_center)),
array('vendor_id' => array('integer', $a_usr_id)));
$this->__read();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilPaymentVendors::$_instance
staticprivate

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

Referenced by getInstance().

ilPaymentVendors::$db = null

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

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: