diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-04-04 18:56:14 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-04-08 12:04:38 +0200 |
commit | 698297feb3cb8e78c0e4adb6756e0ea98da49677 (patch) | |
tree | b5138a46947af308d925742992a1c65b5d74ac29 /lib/private/group/database.php | |
parent | 411a810ebec9f3c6f99debab33098523d376d44d (diff) | |
download | nextcloud-server-698297feb3cb8e78c0e4adb6756e0ea98da49677.tar.gz nextcloud-server-698297feb3cb8e78c0e4adb6756e0ea98da49677.zip |
add optional countUsersInGroup method to group backends
Diffstat (limited to 'lib/private/group/database.php')
-rw-r--r-- | lib/private/group/database.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/group/database.php b/lib/private/group/database.php index d0974685ff6..3815dcff2e5 100644 --- a/lib/private/group/database.php +++ b/lib/private/group/database.php @@ -212,6 +212,20 @@ class OC_Group_Database extends OC_Group_Backend { } /** + * @brief get the number of all users matching the search string in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return int | false + */ + public function countUsersInGroup($gid, $search = '') { + $stmt = OC_DB::prepare('SELECT COUNT(`uid`) AS `count` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ?'); + $result = $stmt->execute(array($gid, $search.'%')); + return $result->fetchOne(); + } + + /** * @brief get a list of all display names in a group * @param string $gid * @param string $search |