ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentVendors Class Reference
+ Collaboration diagram for ilPaymentVendors:

Public Member Functions

 ilPaymentVendors ()
 Constructor public.
 getVendors ()
 isAssigned ($a_usr_id)
 add ($a_usr_id)
 update ($a_usr_id, $a_cost_center)
 delete ($a_usr_id)
 __read ()
 _isVendor ($a_usr_id)
 _getCostCenter ($a_usr_id)

Data Fields

 $db = null
 $vendors = array()

Detailed Description

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

Member Function Documentation

ilPaymentVendors::__read ( )

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

References $res, and $row.

Referenced by add(), delete(), ilPaymentVendors(), 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::_getCostCenter (   $a_usr_id)

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

References $ilDB, $res, and $row.

Referenced by ilPaymentStatisticGUI\addStatisticWorksheet(), and ilObjPaymentSettingsGUI\addStatisticWorksheet().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_vendors WHERE vendor_id = %s',
array('integer'),array($a_usr_id));
while($row = $ilDB->fetchObject($res))
{
return $row->cost_center;
}
return -1;
}

+ Here is the caller graph for this function:

ilPaymentVendors::_isVendor (   $a_usr_id)

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

References $ilDB, and $res.

Referenced by ilPaymentBookings\__getVendorIds(), ilPaymentObjectGUI\__getVendors(), ilPaymentObject\_getObjectsData(), ilPaymentObject\_isPurchasable(), ilShopBaseGUI\buildSubTabs(), ilShopController\buildTabs(), ilPaymentAdminGUI\forwardToDefault(), and ilPaymentCoupons\getVendorIds().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_vendors WHERE vendor_id = %s',
array('integer'), array($a_usr_id));
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

ilPaymentVendors::add (   $a_usr_id)

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

References __read().

{
if(isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::add() Vendor already exists");
}
$statement = $this->db->manipulateF('
INSERT INTO payment_vendors
( vendor_id,
cost_center
) VALUES (%s,%s)',
array('integer', 'text'),
array($a_usr_id, '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 76 of file class.ilPaymentVendors.php.

References __read().

{
if(!isset($this->vendors[$a_usr_id]))
{
die("class.ilPaymentVendors::delete() Vendor does not exist");
}
$statement = $this->db->manipulateF('
DELETE FROM payment_vendors WHERE vendor_id = %s',
array('integer'),
array($a_usr_id));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentVendors::getVendors ( )

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

References $vendors.

{
}
ilPaymentVendors::ilPaymentVendors ( )

Constructor public.

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

References $ilDB, and __read().

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

+ Here is the call graph for this function:

ilPaymentVendors::isAssigned (   $a_usr_id)

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

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

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

References __read().

{
$statement = $this->db->manipulateF('
UPDATE payment_vendors
SET cost_center = %s
WHERE vendor_id = %s',
array('text', 'integer'),
array($a_cost_center, $a_usr_id));
$this->__read();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilPaymentVendors::$db = null

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

ilPaymentVendors::$vendors = array()

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

Referenced by getVendors().


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