diff --git a/classes/Profile.php b/classes/Profile.php index f635ee470d..5eebd64a0d 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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) diff --git a/classes/User_group.php b/classes/User_group.php index 6168f219b9..38cc5603db 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -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