DataObjects/Person.php
authorAlan Knowles <alan@akkbhome.com>
Thu, 14 Apr 2011 00:32:40 +0000 (08:32 +0800)
committerAlan Knowles <alan@akkbhome.com>
Thu, 14 Apr 2011 00:32:40 +0000 (08:32 +0800)
DataObjects/Person.php

index 1c9806f..a757f89 100644 (file)
@@ -353,12 +353,18 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
          
         
     }
-    
+    /**
+     *Basic group fetching - probably needs to filter by type eventually.
+     *
+     */
     
     function groups()
     {
-        
-        
+        $g = DB_DataObject::Factory('Group_Members');
+        $grps = $g->listGroupMembership($this);
+        $g = DB_DataObject::Factory('Groups');
+        $g->whereAddIn('id', $grps, 'int');
+        return $g->fetchAll();
         
     }