ILIAS  Release_4_0_x_branch Revision 61816
 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 ()
 __getTrusteeId ()
 __getStatisticPermissionStatus ()
 __getObjectPermissisonStatus ()
 __getCouponsPermissisonStatus ()
 __read ()
 _deleteTrusteesOfVendor ($a_vendor_id)
 _hasStatisticPermission ($a_trustee)
 _hasObjectPermission ($a_trustee)
 _hasCouponsPermission ($a_trustee)
 _hasStatisticPermissionByVendor ($a_trustee, $a_vendor)
 _hasObjectPermissionByVendor ($a_trustee, $a_vendor)
 _hasCouponsPermissionByVendor ($a_trustee, $a_vendor)
 _hasAccess ($a_usr_id)
 _getVendorsForObjects ($a_usr_id)
 _getVendorsForCouponsByTrusteeId ($a_usr_id)
 _getTrusteesForCouponsByVendorId ($a_usr_id)

Data Fields

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

Detailed Description

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

Member Function Documentation

ilPaymentTrustees::__getCouponsPermissisonStatus ( )

Definition at line 187 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 ( )

Definition at line 183 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 ( )

Definition at line 179 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 ( )

Definition at line 175 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 ( )

Definition at line 191 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:

ilPaymentTrustees::_deleteTrusteesOfVendor (   $a_vendor_id)

Definition at line 212 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:

ilPaymentTrustees::_getTrusteesForCouponsByVendorId (   $a_usr_id)

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:

ilPaymentTrustees::_getVendorsForCouponsByTrusteeId (   $a_usr_id)

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:

ilPaymentTrustees::_getVendorsForObjects (   $a_usr_id)

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

References $ilDB, $res, and $row.

Referenced by ilPaymentBookings\__getVendorIds(), 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:

ilPaymentTrustees::_hasAccess (   $a_usr_id)

Definition at line 328 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:

ilPaymentTrustees::_hasCouponsPermission (   $a_trustee)

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

References $ilDB, $res, and $row.

Referenced by ilPaymentBaseGUI\__buildButtons(), _hasAccess(), and ilShopBaseGUI\buildSubTabs().

{
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:

ilPaymentTrustees::_hasCouponsPermissionByVendor (   $a_trustee,
  $a_vendor 
)

Definition at line 313 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;
}
ilPaymentTrustees::_hasObjectPermission (   $a_trustee)

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

References $ilDB, $res, and $row.

Referenced by ilPaymentBaseGUI\__buildButtons(), _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:

ilPaymentTrustees::_hasObjectPermissionByVendor (   $a_trustee,
  $a_vendor 
)

Definition at line 298 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 $res->numRows() ? true : false;
}
ilPaymentTrustees::_hasStatisticPermission (   $a_trustee)

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

References $ilDB, $res, and $row.

Referenced by ilPaymentBaseGUI\__buildButtons(), _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:

ilPaymentTrustees::_hasStatisticPermissionByVendor (   $a_trustee,
  $a_vendor 
)

Definition at line 283 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 88 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 141 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 160 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 62 of file class.ilPaymentTrustees.php.

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

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

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

Constructor public.

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

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

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

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

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

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

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

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

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

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

Field Documentation

ilPaymentTrustees::$db = null

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

ilPaymentTrustees::$trustees = array()

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

Referenced by _getTrusteesForCouponsByVendorId().

ilPaymentTrustees::$user_obj

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

Referenced by ilPaymentTrustees().


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