[geeklog-cvs] Auth_Enterprise/Common AEGroup.class.php,1.1.1.1,1.2 AEPrivilege.class.php,1.1.1.1,1.2

tony at iowaoutdoors.org tony at iowaoutdoors.org
Sat Jun 19 16:24:00 EDT 2004


Update of /var/cvs/Auth_Enterprise/Common
In directory www:/tmp/cvs-serv16801

Modified Files:
	AEGroup.class.php AEPrivilege.class.php 
Log Message:
Added toArray() method to get around PEAR::XML_RPC limitation with PHP5 objects

Index: AEPrivilege.class.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Common/AEPrivilege.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEPrivilege.class.php	15 Jun 2004 15:19:27 -0000	1.1.1.1
--- AEPrivilege.class.php	19 Jun 2004 20:23:58 -0000	1.2
***************
*** 41,44 ****
--- 41,53 ----
      private $privilegeDesc = null;
      
+     public function toArray()
+     {
+         $tmpArray = array();
+         $tmpArray['privilegeCode'] = $this->privilegeCode;
+         $tmpArray['privilegeDesc'] = $this->privilegeDesc;
+         
+         return $tmpArray;
+     }
+     
      public function __construct($code = '', $desc = '')
      {

Index: AEGroup.class.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Common/AEGroup.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEGroup.class.php	15 Jun 2004 15:19:27 -0000	1.1.1.1
--- AEGroup.class.php	19 Jun 2004 20:23:58 -0000	1.2
***************
*** 59,62 ****
--- 59,92 ----
      
      /**
+     * Converts an instance of this class into an array
+     *
+     * This class is needed because PEAR::XMLRPC is unable to encode PHP5 objects.  Until this is
+     * addressed we will have to use this method before sending objects back to the calling
+     * XMLRPC client application
+     *
+     * @author Tony Bibbs <tony at geeklog.net>
+     * @access public
+     * @return array Array representing this object
+     *
+     */
+     public function toArray()
+     {
+         $tmpArray = array();
+         $tmpArray['groupId'] = $this->groupId;
+         $tmpArray['groupLogicalName'] = $this->groupLogicalName;
+         $tmpArray['groupDisplayName'] = $this->groupDisplayName;
+         $tmpArray['groupDesc'] = $this->groupDesc;
+         $privArray = array();
+         if (is_array($this->privileges)) {
+             foreach($this->privileges as $curPriv) {
+                 $privArray[] = $curPriv;
+             }
+         }
+         $tmpArray['privileges'] = $privArray;
+         
+         return $tmpArray;
+     }
+     
+     /**
      * Sets the group ID
      *




More information about the geeklog-cvs mailing list