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

Public Member Functions

 __construct ($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()
 $perm_stat = null
 $perm_obj = null
 $perm_coupons = null
 $trustee_id = 0

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

ilPaymentTrustees::__construct (   $user_obj)

Constructor public.

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

References $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:

Member Function Documentation

ilPaymentTrustees::__getCouponsPermissisonStatus ( )
private

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

References $perm_coupons.

Referenced by add(), and modify().

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

+ Here is the caller graph for this function:

ilPaymentTrustees::__getObjectPermissisonStatus ( )
private

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

References $perm_obj.

Referenced by add(), and modify().

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

+ Here is the caller graph for this function:

ilPaymentTrustees::__getStatisticPermissionStatus ( )
private

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

References $perm_stat.

Referenced by add(), and modify().

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

+ Here is the caller graph for this function:

ilPaymentTrustees::__getTrusteeId ( )
private

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

References $trustee_id.

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

{
}

+ Here is the caller graph for this function:

ilPaymentTrustees::__read ( )
private

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

References $res, and $row.

Referenced by __construct(), add(), delete(), deleteAll(), 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 199 of file class.ilPaymentTrustees.php.

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 379 of file class.ilPaymentTrustees.php.

References $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 396 of file class.ilPaymentTrustees.php.

References $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 360 of file class.ilPaymentTrustees.php.

References $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 322 of file class.ilPaymentTrustees.php.

References $res, and $row.

Referenced by 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 341 of file class.ilPaymentTrustees.php.

References $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 315 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 250 of file class.ilPaymentTrustees.php.

References $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 300 of file class.ilPaymentTrustees.php.

References $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 230 of file class.ilPaymentTrustees.php.

References $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 285 of file class.ilPaymentTrustees.php.

References $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 211 of file class.ilPaymentTrustees.php.

References $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 270 of file class.ilPaymentTrustees.php.

References $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 75 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 128 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 147 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 49 of file class.ilPaymentTrustees.php.

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

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

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

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

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

Definition at line 99 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 70 of file class.ilPaymentTrustees.php.

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

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

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

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

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

Definition at line 58 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::$perm_coupons = null

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

Referenced by __getCouponsPermissisonStatus().

ilPaymentTrustees::$perm_obj = null

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

Referenced by __getObjectPermissisonStatus().

ilPaymentTrustees::$perm_stat = null

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

Referenced by __getStatisticPermissionStatus().

ilPaymentTrustees::$trustee_id = 0

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

Referenced by __getTrusteeId().

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 __construct().


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