SeedDMS_Core_Group
in package
Class to represent a user group in the document management system
Tags
Table of Contents
Properties
- $_comment : string
- The comment of the user group
- $_dms : SeedDMS_Core_DMS
- Back reference to DMS this user group belongs to
- $_id : int
- The id of the user group
- $_name : string
- The name of the user group
- $_users : array<string|int, SeedDMS_Core_User>
Methods
- __construct() : mixed
- addUser() : bool
- Add user as member
- getAllInstances() : array<string|int, SeedDMS_Core_Group>|bool
- Get all groups
- getApprovalStatus() : mixed
- getComment() : string
- Return comment of group
- getDMS() : SeedDMS_Core_DMS
- getID() : int
- Return internal id of group
- getInstance() : SeedDMS_Core_Group|bool
- Return an instance of a group object
- getManagers() : array<string|int, SeedDMS_Core_User>|bool
- Get all users which are managers of the group
- getName() : string
- Return name of group
- getNotifications() : array<string|int, SeedDMS_Core_Notification>|bool
- Get all notifications of group
- getReceiptStatus() : mixed
- getReviewStatus() : mixed
- getRevisionStatus() : mixed
- getUsers() : array<string|int, SeedDMS_Core_User>|bool
- Get all users which are members of the group
- getWorkflowStatus() : bool|array<string|int, mixed>
- Get a list of documents with a workflow
- isMember() : bool
- Check if user is member of group
- isType() : mixed
- Check if this object is of type 'group'.
- remove() : bool
- Delete user group
- removeUser() : bool
- Remove users as a member of the group
- setComment() : bool
- Set new comment of group
- setDMS() : mixed
- setName() : bool
- Set new name of group
- toggleManager() : bool
- Toggle manager status of user
Properties
$_comment
The comment of the user group
protected
string
$_comment
$_dms
Back reference to DMS this user group belongs to
protected
SeedDMS_Core_DMS
$_dms
$_id
The id of the user group
protected
int
$_id
$_name
The name of the user group
protected
string
$_name
$_users
protected
array<string|int, SeedDMS_Core_User>
$_users
Methods
__construct()
public
__construct(mixed $id, mixed $name, mixed $comment) : mixed
Parameters
- $id : mixed
- $name : mixed
- $comment : mixed
addUser()
Add user as member
public
addUser(SeedDMS_Core_User $user[, bool $asManager = false ]) : bool
Parameters
- $user : SeedDMS_Core_User
- $asManager : bool = false
-
if set, user will be a manager of the group
Return values
boolgetAllInstances()
Get all groups
public
static getAllInstances( $orderby, SeedDMS_Core_DMS $dms) : array<string|int, SeedDMS_Core_Group>|bool
Parameters
- $orderby :
-
set to
name
for odering by name - $dms : SeedDMS_Core_DMS
Return values
array<string|int, SeedDMS_Core_Group>|bool —list of groups or false in case of an error
getApprovalStatus()
public
getApprovalStatus([mixed $documentID = null ][, mixed $version = null ]) : mixed
Parameters
- $documentID : mixed = null
- $version : mixed = null
getComment()
Return comment of group
public
getComment() : string
Return values
stringgetDMS()
public
getDMS() : SeedDMS_Core_DMS
Return values
SeedDMS_Core_DMS —$dms
getID()
Return internal id of group
public
getID() : int
Return values
intgetInstance()
Return an instance of a group object
public
static getInstance(string|int $id, SeedDMS_Core_DMS $dms[, string $by = '' ]) : SeedDMS_Core_Group|bool
Parameters
- $id : string|int
-
Id, name of group, depending on the 3rd parameter.
- $dms : SeedDMS_Core_DMS
-
instance of dms
- $by : string = ''
-
search by group name if set to 'name'. Search by Id of group if left empty.
Return values
SeedDMS_Core_Group|bool —instance of class SeedDMS_Core_Group if group was found, null if group was not found, false in case of error
getManagers()
Get all users which are managers of the group
public
getManagers() : array<string|int, SeedDMS_Core_User>|bool
Return values
array<string|int, SeedDMS_Core_User>|boolgetName()
Return name of group
public
getName() : string
Return values
stringgetNotifications()
Get all notifications of group
public
getNotifications([int $type = 0 ]) : array<string|int, SeedDMS_Core_Notification>|bool
Parameters
- $type : int = 0
-
type of item (T_DOCUMENT or T_FOLDER)
Return values
array<string|int, SeedDMS_Core_Notification>|bool —array of notifications
getReceiptStatus()
public
getReceiptStatus([mixed $documentID = null ][, mixed $version = null ]) : mixed
Parameters
- $documentID : mixed = null
- $version : mixed = null
getReviewStatus()
public
getReviewStatus([mixed $documentID = null ][, mixed $version = null ]) : mixed
Parameters
- $documentID : mixed = null
- $version : mixed = null
getRevisionStatus()
public
getRevisionStatus([mixed $documentID = null ][, mixed $version = null ]) : mixed
Parameters
- $documentID : mixed = null
- $version : mixed = null
getUsers()
Get all users which are members of the group
public
getUsers() : array<string|int, SeedDMS_Core_User>|bool
Return values
array<string|int, SeedDMS_Core_User>|boolgetWorkflowStatus()
Get a list of documents with a workflow
public
getWorkflowStatus([int $documentID = null ][, int $version = null ]) : bool|array<string|int, mixed>
Parameters
- $documentID : int = null
-
optional document id for which to retrieve the reviews
- $version : int = null
-
optional version of the document
Return values
bool|array<string|int, mixed> —list of all workflows
isMember()
Check if user is member of group
public
isMember(SeedDMS_Core_User $user[, bool $asManager = false ]) : bool
Parameters
- $user : SeedDMS_Core_User
-
user to be checked
- $asManager : bool = false
-
also check whether user is manager of group if set to true, otherwise does not care about manager status
Return values
bool —true if user is member, otherwise false
isType()
Check if this object is of type 'group'.
public
isType(string $type) : mixed
Parameters
- $type : string
-
type of object
remove()
Delete user group
public
remove(SeedDMS_Core_User $user) : bool
This method deletes the user group and all its references, like access control lists, notifications, etc.
Parameters
- $user : SeedDMS_Core_User
-
the user doing the removal (needed for entry in review log.
Return values
bool —true on success or false in case of an error
removeUser()
Remove users as a member of the group
public
removeUser(SeedDMS_Core_User $user) : bool
Parameters
- $user : SeedDMS_Core_User
Return values
boolsetComment()
Set new comment of group
public
setComment( $newComment) : bool
Parameters
Return values
bool —true on success, otherwise false
setDMS()
public
setDMS(SeedDMS_Core_DMS $dms) : mixed
Parameters
- $dms : SeedDMS_Core_DMS
setName()
Set new name of group
public
setName( $newName) : bool
Parameters
Return values
bool —true on success, otherwise false
toggleManager()
Toggle manager status of user
public
toggleManager(SeedDMS_Core_User $user) : bool
Parameters
- $user : SeedDMS_Core_User
Return values
bool —true if operation was successful, otherwise false