use multiGet() for a profile's groups

This commit is contained in:
Evan Prodromou 2011-08-01 15:18:29 -04:00
parent 874f1db389
commit a3ef80941e
2 changed files with 6 additions and 10 deletions

View 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)

View 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