]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use multiGet() for a profile's groups
authorEvan Prodromou <evan@status.net>
Mon, 1 Aug 2011 19:18:29 +0000 (15:18 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 1 Aug 2011 19:18:29 +0000 (15:18 -0400)
classes/Profile.php
classes/User_group.php

index f635ee470df8a2f596055a5b5729d5808264afd6..5eebd64a0d39401fd75a2e1db38af1f8abc80b71 100644 (file)
@@ -273,16 +273,7 @@ class Profile extends Memcached_DataObject
             self::cacheSet($keypart, implode(',', $ids));
         }
 
-        $groups = array();
-
-        foreach ($ids as $id) {
-            $group = User_group::staticGet('id', $id);
-            if (!empty($group)) {
-                $groups[] = $group;
-            }
-        }
-
-        return new ArrayWrapper($groups);
+        return User_group::multiGet('id', $ids);
     }
 
     function isTagged($peopletag)
index 6168f219b998d51a022a9bb93d6efd51ae2c8724..38cc5603db3c6f77648c8332e68dc69de6e0a611 100644 (file)
@@ -33,6 +33,11 @@ class User_group extends Memcached_DataObject
     function staticGet($k,$v=NULL) {
         return Memcached_DataObject::staticGet('User_group',$k,$v);
     }
+    
+    function multiGet($keyCol, $keyVals, $skipNulls=true)
+    {
+        return parent::multiGet('User_group', $keyCol, $keyVals, $skipNulls);
+    }
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE