ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentTrustees Class Reference
+ Collaboration diagram for ilPaymentTrustees:

Public Member Functions

 ilPaymentTrustees ($user_obj)
 Constructor public.
 getTrustees ()
 getTrustee ($a_usr_id)
 isTrustee ($a_usr_id)
 toggleStatisticPermission ($a_on)
 toggleObjectPermission ($a_on)
 toggleCouponsPermission ($a_on)
 setTrusteeId ($a_id)
 add ()
 modify ()
 delete ()
 deleteAll ()

Static Public Member Functions

static _deleteTrusteesOfVendor ($a_vendor_id)
static _hasStatisticPermission ($a_trustee)
static _hasObjectPermission ($a_trustee)
static _hasCouponsPermission ($a_trustee)
static _hasStatisticPermissionByVendor ($a_trustee, $a_vendor)
static _hasObjectPermissionByVendor ($a_trustee, $a_vendor)
static _hasCouponsPermissionByVendor ($a_trustee, $a_vendor)
static _hasAccess ($a_usr_id)
static _getVendorsForObjects ($a_usr_id)
static _getVendorsForStatisticsByTrusteeId ($a_trustee_id)
static _getVendorsForCouponsByTrusteeId ($a_usr_id)
static _getTrusteesForCouponsByVendorId ($a_usr_id)
static _getVendorIdsByTrustee ($a_usr_id)

Data Fields

 $db = null
 $user_obj
 $trustees = array()

Private Member Functions

 __getTrusteeId ()
 __getStatisticPermissionStatus ()
 __getObjectPermissisonStatus ()
 __getCouponsPermissisonStatus ()
 __read ()

Detailed Description

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

Member Function Documentation

ilPaymentTrustees::__getCouponsPermissisonStatus ( )
private

Definition at line 168 of file class.ilPaymentTrustees.php.

Referenced by add(), and modify().

{
return (int) $this->perm_coupons;
}

+ Here is the caller graph for this function:

ilPaymentTrustees::__getObjectPermissisonStatus ( )
private

Definition at line 164 of file class.ilPaymentTrustees.php.

Referenced by add(), and modify().

{
return (int) $this->perm_obj;
}

+ Here is the caller graph for this function:

ilPaymentTrustees::__getStatisticPermissionStatus ( )
private

Definition at line 160 of file class.ilPaymentTrustees.php.

Referenced by add(), and modify().

{
return (int) $this->perm_stat;
}

+ Here is the caller graph for this function:

ilPaymentTrustees::__getTrusteeId ( )
private

Definition at line 156 of file class.ilPaymentTrustees.php.

Referenced by add(), delete(), and modify().

{
return $this->trustee_id;
}

+ Here is the caller graph for this function:

ilPaymentTrustees::__read ( )
private

Definition at line 172 of file class.ilPaymentTrustees.php.

References $res, and $row.

Referenced by add(), delete(), deleteAll(), ilPaymentTrustees(), and modify().

{
$this->trustees = array();
$res = $this->db->queryf('
SELECT * FROM payment_trustees
WHERE vendor_id = %s',
array('integer'),
array($this->user_obj->getId()));
while($row = $this->db->fetchObject($res))
{
$this->trustees[$row->trustee_id]['trustee_id'] = $row->trustee_id;
$this->trustees[$row->trustee_id]['perm_stat'] = $row->perm_stat;
$this->trustees[$row->trustee_id]['perm_obj'] = $row->perm_obj;
$this->trustees[$row->trustee_id]['perm_coupons'] = $row->perm_coupons;
}
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_deleteTrusteesOfVendor (   $a_vendor_id)
static

Definition at line 193 of file class.ilPaymentTrustees.php.

References $ilDB.

Referenced by ilObjPaymentSettingsGUI\performDeleteVendorsObject().

{
global $ilDB;
$statement = $ilDB->manipulateF('
DELETE FROM payment_trustees
WHERE vendor_id = %s',
array('integer'), array($a_vendor_id));
return true;
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_getTrusteesForCouponsByVendorId (   $a_usr_id)
static

Definition at line 373 of file class.ilPaymentTrustees.php.

References $ilDB, $res, $row, and $trustees.

Referenced by ilPaymentCoupons\getVendorIds().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT trustee_id FROM payment_trustees
WHERE vendor_id = %s
AND perm_coupons = %s ',
array('integer', 'integer'), array($a_usr_id, '1'));
while($row = $ilDB->fetchObject($res))
{
$trustees[] = $row->trustee_id;
}
return $trustees ? $trustees : array();
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_getVendorIdsByTrustee (   $a_usr_id)
static

Definition at line 390 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by ilPaymentObject\_hasAccess().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT vendor_id FROM payment_trustees WHERE trustee_id = %s',
array('integer'), array($a_usr_id));
while($row = $ilDB->fetchObject($res))
{
$vendors[] = $row->vendor_id;
}
return $vendors ? $vendors : array();
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_getVendorsForCouponsByTrusteeId (   $a_usr_id)
static

Definition at line 354 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by ilPaymentCoupons\getVendorIds().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT vendor_id FROM payment_trustees
WHERE trustee_id = %s
AND perm_coupons = %s ',
array('integer', 'integer'),
array($a_usr_id, '1'));
while($row = $ilDB->fetchObject($res))
{
$vendors[] = $row->vendor_id;
}
return $vendors ? $vendors : array();
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_getVendorsForObjects (   $a_usr_id)
static

Definition at line 316 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by ilPaymentObjectGUI\__getVendors(), ilPaymentObject\_getObjectsData(), and ilPaymentObject\_isPurchasable().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT vendor_id FROM payment_trustees
WHERE trustee_id = %s
AND perm_obj = %s ',
array('integer', 'integer'),
array($a_usr_id, '1'));
while($row = $ilDB->fetchObject($res))
{
$vendors[] = $row->vendor_id;
}
return $vendors ? $vendors : array();
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_getVendorsForStatisticsByTrusteeId (   $a_trustee_id)
static

Definition at line 335 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by ilPaymentBookings\__getVendorIds().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT vendor_id FROM payment_trustees
WHERE trustee_id = %s
AND perm_stat = %s ',
array('integer', 'integer'),
array($a_trustee_id, '1'));
while($row = $ilDB->fetchObject($res))
{
$vendors[] = $row->vendor_id;
}
return $vendors ? $vendors : array();
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_hasAccess (   $a_usr_id)
static

Definition at line 309 of file class.ilPaymentTrustees.php.

References _hasCouponsPermission(), _hasObjectPermission(), and _hasStatisticPermission().

Referenced by ilShopController\buildTabs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPaymentTrustees::_hasCouponsPermission (   $a_trustee)
static

Definition at line 244 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilShopBaseGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s',
array('integer'),
array($a_trustee));
while($row = $ilDB->fetchObject($res))
{
if((bool) $row->perm_coupons)
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_hasCouponsPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 294 of file class.ilPaymentTrustees.php.

References $ilDB, and $res.

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s
AND vendor_id = %s
AND perm_coupons = %s',
array('integer', 'integer', 'integer' ),
array($a_trustee, $a_vendor, '1'));
return $res->numRows() ? true : false;
}
static ilPaymentTrustees::_hasObjectPermission (   $a_trustee)
static

Definition at line 224 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilShopBaseGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s',
array('integer'),
array($a_trustee));
while($row = $ilDB->fetchObject($res))
{
if((bool) $row->perm_obj)
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_hasObjectPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 279 of file class.ilPaymentTrustees.php.

References $ilDB, and $res.

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s
AND vendor_id = %s
AND perm_obj = %s',
array('integer', 'integer', 'integer' ),
array($a_trustee, $a_vendor, '1'));
return $ilDB->numRows($res) ? true : false;
}
static ilPaymentTrustees::_hasStatisticPermission (   $a_trustee)
static

Definition at line 205 of file class.ilPaymentTrustees.php.

References $ilDB, $res, and $row.

Referenced by _hasAccess(), ilShopBaseGUI\buildSubTabs(), and ilPaymentAdminGUI\forwardToDefault().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s',
array('integer'), array($a_trustee));
while($row = $ilDB->fetchObject($res))
{
if((bool) $row->perm_stat)
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentTrustees::_hasStatisticPermissionByVendor (   $a_trustee,
  $a_vendor 
)
static

Definition at line 264 of file class.ilPaymentTrustees.php.

References $ilDB, and $res.

Referenced by ilPaymentBookings\__getVendorIds().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_trustees
WHERE trustee_id = %s
AND vendor_id = %s
AND perm_stat = %s',
array('integer', 'integer', 'integer' ),
array($a_trustee, $a_vendor, '1'));
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

ilPaymentTrustees::add ( )

Definition at line 69 of file class.ilPaymentTrustees.php.

References __getCouponsPermissisonStatus(), __getObjectPermissisonStatus(), __getStatisticPermissionStatus(), __getTrusteeId(), and __read().

{
$statement = $this->db->manipulateF('
INSERT INTO payment_trustees
( vendor_id,
trustee_id,
perm_stat,
perm_coupons,
perm_obj
)
VALUES (%s,%s,%s,%s,%s)',
array('integer', 'integer', 'integer', 'integer', 'integer'),
array( $this->user_obj->getId(),
$this->__getTrusteeId(),
));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrustees::delete ( )

Definition at line 122 of file class.ilPaymentTrustees.php.

References __getTrusteeId(), and __read().

{
if(!$this->__getTrusteeId())
{
die("ilPaymentTrustees::delete() no id given");
}
$statement = $this->db->manipulateF('
DELETE FROM payment_trustees
WHERE vendor_id = %s
AND trustee_id = %s ',
array('integer', 'integer'),
array($this->user_obj->getId(), $this->__getTrusteeId()));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrustees::deleteAll ( )

Definition at line 141 of file class.ilPaymentTrustees.php.

References __read().

{
$statement = $this->db->manipulateF('
DELETE FROM payment_trustees
WHERE vendor_id = %s',
array('integer'),
array($this->user_obj->getId()));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrustees::getTrustee (   $a_usr_id)

Definition at line 43 of file class.ilPaymentTrustees.php.

{
return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
}
ilPaymentTrustees::getTrustees ( )

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

{
return $this->trustees ? $this->trustees : array();
}
ilPaymentTrustees::ilPaymentTrustees (   $user_obj)

Constructor public.

Definition at line 26 of file class.ilPaymentTrustees.php.

References $ilDB, $user_obj, and __read().

{
global $ilDB;
$this->db = $ilDB;
$this->user_obj = $user_obj;
$this->PERM_STATISTIC = 1;
$this->PERM_OBJECT = 2;
$this->__read();
}

+ Here is the call graph for this function:

ilPaymentTrustees::isTrustee (   $a_usr_id)

Definition at line 47 of file class.ilPaymentTrustees.php.

{
return isset($this->trustees[$a_usr_id]);
}
ilPaymentTrustees::modify ( )

Definition at line 93 of file class.ilPaymentTrustees.php.

References __getCouponsPermissisonStatus(), __getObjectPermissisonStatus(), __getStatisticPermissionStatus(), __getTrusteeId(), and __read().

{
if(!$this->__getTrusteeId())
{
die("ilPaymentTrustees::modify() no id given");
}
$statement = $this->db->manipulateF('
UPDATE payment_trustees
SET trustee_id = %s,
perm_stat = %s,
perm_obj = %s,
perm_coupons = %s
WHERE vendor_id = %s
AND trustee_id = %s',
array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'),
array( $this->__getTrusteeId(),
$this->user_obj->getId(),
$this->__getTrusteeId()
));
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrustees::setTrusteeId (   $a_id)

Definition at line 64 of file class.ilPaymentTrustees.php.

{
$this->trustee_id = $a_id;
}
ilPaymentTrustees::toggleCouponsPermission (   $a_on)

Definition at line 60 of file class.ilPaymentTrustees.php.

{
$this->perm_coupons = (bool) $a_on;
}
ilPaymentTrustees::toggleObjectPermission (   $a_on)

Definition at line 56 of file class.ilPaymentTrustees.php.

{
$this->perm_obj = (bool) $a_on;
}
ilPaymentTrustees::toggleStatisticPermission (   $a_on)

Definition at line 52 of file class.ilPaymentTrustees.php.

{
$this->perm_stat = (bool) $a_on;
}

Field Documentation

ilPaymentTrustees::$db = null

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

ilPaymentTrustees::$trustees = array()

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

Referenced by _getTrusteesForCouponsByVendorId().

ilPaymentTrustees::$user_obj

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

Referenced by ilPaymentTrustees().


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