diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-25 23:00:46 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-25 23:00:46 -0700 |
commit | 994768b82101fdd2a08a92e30967ded6714b87dc (patch) | |
tree | bce337781fc5d4f399afa483b51596fb8166eedc /classes/User_group.php | |
parent | b53b6b8769d5531c16ba58d4560119bcee8b39ff (diff) |
break up big inbox queries into lots of small ones
Diffstat (limited to 'classes/User_group.php')
-rw-r--r-- | classes/User_group.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php index 8a56b9e52..9b4b01ead 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -246,4 +246,28 @@ class User_group extends Memcached_DataObject return Design::staticGet('id', $this->design_id); } + function getUserMembers() + { + // XXX: cache this + + $user = new User(); + + $qry = + 'SELECT id ' . + 'FROM user JOIN group_member '. + 'ON user.id = group_member.profile_id ' . + 'WHERE group_member.group_id = %d '; + + $user->query(sprintf($qry, $this->id)); + + $ids = array(); + + while ($user->fetch()) { + $ids[] = $user->id; + } + + $user->free(); + + return $ids; + } } |