summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2010-08-16 02:52:23 +0000
committerBrenda Wallace <shiny@cpan.org>2010-08-16 02:52:23 +0000
commit640e7e7c43fa8e9b1a8516b486e560df84bd9887 (patch)
tree26f895ccbdbc4510d377e283a47bf66c52d5d5a7 /classes/User_group.php
parentaf4fd327429fcc01769b33ece458a77a37b2463f (diff)
parentc1cab9bfb83496d941f9a4da918d1e9221f3a08a (diff)
Merge commit 'origin/0.9.x' into 0.9.x
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index 110f08301..0b83cfd47 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -154,6 +154,21 @@ class User_group extends Memcached_DataObject
return $members;
}
+ function getMemberCount()
+ {
+ // XXX: WORM cache this
+
+ $members = $this->getMembers();
+ $member_count = 0;
+
+ /** $member->count() doesn't work. */
+ while ($members->fetch()) {
+ $member_count++;
+ }
+
+ return $member_count;
+ }
+
function getAdmins($offset=0, $limit=null)
{
$qry =
@@ -477,6 +492,7 @@ class User_group extends Memcached_DataObject
if (!$result) {
common_log_db_error($group, 'INSERT', __FILE__);
+ // TRANS: Server exception thrown when creating a group failed.
throw new ServerException(_('Could not create group.'));
}
@@ -486,6 +502,7 @@ class User_group extends Memcached_DataObject
$result = $group->update($orig);
if (!$result) {
common_log_db_error($group, 'UPDATE', __FILE__);
+ // TRANS: Server exception thrown when updating a group URI failed.
throw new ServerException(_('Could not set group URI.'));
}
}
@@ -493,6 +510,7 @@ class User_group extends Memcached_DataObject
$result = $group->setAliases($aliases);
if (!$result) {
+ // TRANS: Server exception thrown when creating group aliases failed.
throw new ServerException(_('Could not create aliases.'));
}
@@ -507,6 +525,7 @@ class User_group extends Memcached_DataObject
if (!$result) {
common_log_db_error($member, 'INSERT', __FILE__);
+ // TRANS: Server exception thrown when setting group membership failed.
throw new ServerException(_('Could not set group membership.'));
}
@@ -521,6 +540,7 @@ class User_group extends Memcached_DataObject
if (!$result) {
common_log_db_error($local_group, 'INSERT', __FILE__);
+ // TRANS: Server exception thrown when saving local group information failed.
throw new ServerException(_('Could not save local group info.'));
}
}