diff options
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 9b4b01ead..27b444705 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -126,6 +126,30 @@ class User_group extends Memcached_DataObject return $members; } + function getAdmins($offset=0, $limit=null) + { + $qry = + 'SELECT profile.* ' . + 'FROM profile JOIN group_member '. + 'ON profile.id = group_member.profile_id ' . + 'WHERE group_member.group_id = %d ' . + 'AND group_member.is_admin = 1 ' . + 'ORDER BY group_member.modified ASC '; + + if ($limit != null) { + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } + } + + $admins = new Profile(); + + $admins->query(sprintf($qry, $this->id)); + return $admins; + } + function getBlocked($offset=0, $limit=null) { $qry = |