]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Merge commit 'origin/testing' into 0.9.x
[quix0rs-gnu-social.git] / classes / User.php
index 357c1e501343ed324d3de3eb5aa1780dd394be00..fade0f35deaa28f930c346fa4c80a21d3e0d4d4f 100644 (file)
@@ -613,28 +613,8 @@ class User extends Memcached_DataObject
 
     function getGroups($offset=0, $limit=null)
     {
-        $qry =
-          'SELECT user_group.* ' .
-          'FROM user_group JOIN group_member '.
-          'ON user_group.id = group_member.group_id ' .
-          'WHERE group_member.profile_id = %d ' .
-          'ORDER BY group_member.created DESC ';
-
-        if ($offset>0 && !is_null($limit)) {
-            if ($offset) {
-                if (common_config('db','type') == 'pgsql') {
-                    $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
-                } else {
-                    $qry .= ' LIMIT ' . $offset . ', ' . $limit;
-                }
-            }
-        }
-
-        $groups = new User_group();
-
-        $cnt = $groups->query(sprintf($qry, $this->id));
-
-        return $groups;
+        $profile = $this->getProfile();
+        return $profile->getGroups($offset, $limit);
     }
 
     function getSubscriptions($offset=0, $limit=null)