Public Member Functions | Data Fields

ilPaymentTrustees Class Reference

Public Member Functions

 ilPaymentTrustees (&$user_obj)
 Constructor public.
 getTrustees ()
 getTrustee ($a_usr_id)
 isTrustee ($a_usr_id)
 toggleStatisticPermission ($a_on)
 toggleObjectPermission ($a_on)
 setTrusteeId ($a_id)
 add ()
 modify ()
 delete ()
 deleteAll ()
 __getTrusteeId ()
 __getStatisticPermissionStatus ()
 __getObjectPermissisonStatus ()
 __read ()
 _deleteTrusteesOfVendor ($a_vendor_id)
 _hasStatisticPermission ($a_trustee)
 _hasObjectPermission ($a_trustee)
 _hasStatisticPermissionByVendor ($a_trustee, $a_vendor)
 _hasObjectPermissionByVendor ($a_trustee, $a_vendor)
 _hasAccess ($a_usr_id)
 _getVendorsForObjects ($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::__getObjectPermissisonStatus (  ) 

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

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

ilPaymentTrustees::__getStatisticPermissionStatus (  ) 

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

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

ilPaymentTrustees::__getTrusteeId (  ) 

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

Referenced by delete(), and modify().

        {
                return $this->trustee_id;
        }

Here is the caller graph for this function:

ilPaymentTrustees::__read (  ) 

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

References $query, $res, and $row.

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

        {
                $this->trustees = array();

                $query = "SELECT * FROM payment_trustees ".
                        "WHERE vendor_id = '".$this->user_obj->getId()."'";

                $res = $this->db->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $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;
                }
        }

Here is the caller graph for this function:

ilPaymentTrustees::_deleteTrusteesOfVendor ( a_vendor_id  ) 

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

References $query.

Referenced by ilObjPaymentSettingsGUI::performDeleteVendorsObject().

        {
                global $ilDB;

                $query = "DELETE FROM payment_trustees ".
                        "WHERE vendor_id = '".$a_vendor_id."'";

                $ilDB->query($query);

                return true;
        }

Here is the caller graph for this function:

ilPaymentTrustees::_getVendorsForObjects ( a_usr_id  ) 

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

References $query, $res, and $row.

Referenced by ilPaymentBookings::__getVendorIds(), ilPaymentObjectGUI::__showVendorSelector(), and ilPaymentObject::_getObjectsData().

        {
                global $ilDB;

                $query = "SELECT vendor_id FROM payment_trustees ".
                        "WHERE perm_obj = '1' ".
                        "AND trustee_id = '".$a_usr_id."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $vendors[] = $row->vendor_id;
                }

                return $vendors ? $vendors : array();
        }

Here is the caller graph for this function:

ilPaymentTrustees::_hasAccess ( a_usr_id  ) 

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

References _hasObjectPermission(), and _hasStatisticPermission().

Referenced by ilPersonalDesktopGUI::setTabs().

Here is the call graph for this function:

Here is the caller graph for this function:

ilPaymentTrustees::_hasObjectPermission ( a_trustee  ) 

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

References $query, $res, and $row.

Referenced by ilPaymentBaseGUI::__buildButtons(), ilPaymentAdminGUI::__forwardToDefault(), and _hasAccess().

        {
                global $ilDB;
                
                $query = "SELECT * FROM payment_trustees ".
                        "WHERE trustee_id = '".$a_trustee."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        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 236 of file class.ilPaymentTrustees.php.

References $query, and $res.

        {
                global $ilDB;

                $query = "SELECT * FROM payment_trustees ".
                        "WHERE trustee_id = '".$a_trustee."' ".
                        "AND vendor_id = '".$a_vendor."' ".
                        "AND perm_obj = '1'";

                $res = $ilDB->query($query);

                return $res->numRows() ? true : false;
        }

ilPaymentTrustees::_hasStatisticPermission ( a_trustee  ) 

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

References $query, $res, and $row.

Referenced by ilPaymentBaseGUI::__buildButtons(), ilPaymentAdminGUI::__forwardToDefault(), and _hasAccess().

        {
                global $ilDB;
                
                $query = "SELECT * FROM payment_trustees ".
                        "WHERE trustee_id = '".$a_trustee."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        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 222 of file class.ilPaymentTrustees.php.

References $query, and $res.

Referenced by ilPaymentBookings::__getVendorIds().

        {
                global $ilDB;

                $query = "SELECT * FROM payment_trustees ".
                        "WHERE trustee_id = '".$a_trustee."' ".
                        "AND vendor_id = '".$a_vendor."' ".
                        "AND perm_stat = '1'";

                $res = $ilDB->query($query);

                return $res->numRows() ? true : false;
        }

Here is the caller graph for this function:

ilPaymentTrustees::add (  ) 

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

References $query, and __read().

        {
                $query = "INSERT INTO payment_trustees ".
                        "SET vendor_id = '".$this->user_obj->getId()."', ".
                        "trustee_id = '".$this->__getTrusteeId()."', ".
                        "perm_stat = '".$this->__getStatisticPermissionStatus()."', ".
                        "perm_obj = '".$this->__getObjectPermissisonStatus()."'";
                
                $this->db->query($query);
                $this->__read();

                return true;
        }

Here is the call graph for this function:

ilPaymentTrustees::delete (  ) 

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

References $query, __getTrusteeId(), and __read().

        {
                if(!$this->__getTrusteeId())
                {
                        die("ilPaymentTrustees::delete() no id given");
                }
                $query = "DELETE FROM payment_trustees ".
                        "WHERE vendor_id = '".$this->user_obj->getId()."' ".
                        "AND trustee_id = '".$this->__getTrusteeId()."'";

                $this->db->query($query);
                $this->__read();

                return true;
        }

Here is the call graph for this function:

ilPaymentTrustees::deleteAll (  ) 

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

References $query, and __read().

        {
                $query = "DELETE FROM payment_trustees ".
                        "WHERE vendor_id = '".$this->user_obj->getId()."'";

                $this->db->query($query);
                $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 $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 99 of file class.ilPaymentTrustees.php.

References $query, __getTrusteeId(), and __read().

        {
                if(!$this->__getTrusteeId())
                {
                        die("ilPaymentTrustees::modify() no id given");
                }

                $query = "UPDATE payment_trustees SET ".
                        "trustee_id = '".$this->__getTrusteeId()."', ".
                        "perm_stat = '".$this->__getStatisticPermissionStatus()."', ".
                        "perm_obj = '".$this->__getObjectPermissisonStatus()."' ".
                        "WHERE vendor_id = '".$this->user_obj->getId()."' ".
                        "AND trustee_id = '".$this->__getTrusteeId()."'";

                $this->db->query($query);
                $this->__read();

                return true;
        }

Here is the call graph for this function:

ilPaymentTrustees::setTrusteeId ( a_id  ) 

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

        {
                $this->trustee_id = $a_id;
        }

ilPaymentTrustees::toggleObjectPermission ( a_on  ) 

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

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

ilPaymentTrustees::toggleStatisticPermission ( a_on  ) 

Definition at line 73 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.

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: