Database¶
- 
class OC\Group\Database¶
- Class for group management in a SQL Database (e.g. MySQL, SQLite)
Properties¶
Methods¶
- 
public OC\Group\Database::__construct($dbConn=null)¶
- \OC\Group\Database constructor.Source: Parameters: - $dbConn (OCP\IDBConnection| null)
 
- $dbConn (
- 
public OC\Group\Database::createGroup($gid)¶
- Try to create a new groupSource: Parameters: - $gid (string) The name of the group to create
 Returns: bool Tries to create a new group. If the group name already exists, false will be returned. 
- 
public OC\Group\Database::deleteGroup($gid)¶
- delete a groupSource: Parameters: - $gid (string) gid of the group to delete
 Returns: bool Deletes a group and removes it from the group_user-table 
- 
public OC\Group\Database::inGroup($uid, $gid)¶
- is user in group?Source: Parameters: - $uid (string) uid of the user
- $gid (string) gid of the group
 Returns: bool Checks whether the user is member of a group or not. 
- 
public OC\Group\Database::addToGroup($uid, $gid)¶
- Add a user to a groupSource: Parameters: - $uid (string) Name of the user to add to group
- $gid (string) Name of the group in which add the user
 Returns: bool Adds a user to a group. 
- 
public OC\Group\Database::removeFromGroup($uid, $gid)¶
- Removes a user from a groupSource: Parameters: - $uid (string) Name of the user to remove from group
- $gid (string) Name of the group from which remove the user
 Returns: bool removes the user from a group. 
- 
public OC\Group\Database::getUserGroups($uid)¶
- Get all groups a user belongs toSource: Parameters: - $uid (string) Name of the user
 Returns: array an array of group names This function fetches all groups a user belongs to. It does not check if the user exists at all. 
- 
public OC\Group\Database::getGroups($search="", $limit=null, $offset=null)¶
- get a list of all groupsSource: Parameters: - $search (string)
- $limit (int)
- $offset (int)
 Returns: array an array of group names Returns a list with all groups 
- 
public OC\Group\Database::groupExists($gid)¶
- check if a group existsSource: Parameters: - $gid (string)
 Returns: bool 
- 
public OC\Group\Database::usersInGroup($gid, $search="", $limit=-1, $offset=0)¶
- get a list of all users in a groupSource: Parameters: - $gid (string)
- $search (string)
- $limit (int)
- $offset (int)
 Returns: array an array of user ids 
- 
public OC\Group\Database::countUsersInGroup($gid, $search="")¶
- get the number of all users matching the search string in a groupSource: Parameters: - $gid (string)
- $search (string)
 Returns: int 
- 
public OC\Group\Database::countDisabledInGroup($gid)¶
- get the number of disabled users in a groupSource: lib/private/Group/Database.php#434 Parameters: Returns: int 
- 
public OC\Group\Database::getDisplayName($gid)¶
- Source: - lib/private/Group/Database.php#459 
- 
public OC\Group\Database::getGroupDetails($gid)¶
- Source: - lib/private/Group/Database.php#478 
- 
public OC\Group\Database::setDisplayName($gid, $displayName)¶
- Source: - lib/private/Group/Database.php#487 
- 
public OC\Group\Database::getBackendName()¶
- Backend name to be shown in group managementSource: lib/private/Group/Database.php#513 Returns: string the name of the backend to be shown Since: 21.0.0