UserGroup
in package
User Group Object
Tags
Table of Contents
Properties
- $EOF : mixed
- $arrAttributes : mixed
- $arrCache : mixed
- $arrDynamicPermissions : mixed
- $arrLoadedGroups : mixed
- $arrStaticPermissions : mixed
- $arrTypes : mixed
- $arrUsers : array<string|int, mixed>|null|bool
- `load()` initializes this as null. `loadUsers()` either returns an array or false.
- $defaultType : mixed
- $description : mixed
- $error_msg : string
- Contains the message if an error occurs
- $homepage : mixed
- $id : mixed
- $is_active : mixed
- $name : mixed
- $type : mixed
Methods
- __construct() : mixed
- delete() : bool
- Deletes this group from DB
- first() : mixed
- Load first group
- getActiveStatus() : mixed
- getAssociatedUserIds() : array<string|int, mixed>|false
- Returns a list of user IDs associated to this group
- getDescription() : mixed
- getDynamicPermissionIds() : mixed
- getErrorMsg() : mixed
- getGroup() : UserGroup
- Returns the UserGroup for the given ID
- getGroupCount() : mixed
- getGroups() : mixed
- getHomepage() : mixed
- getId() : mixed
- getLoadedGroupCount() : mixed
- getLoadedGroupIds() : mixed
- getName() : mixed
- getNameArray() : array<string|int, mixed>
- Returns an array of all available user group names, indexed by their ID
- getStaticPermissionIds() : mixed
- getType() : mixed
- getTypes() : mixed
- getUserCount() : mixed
- isUniqueGroupName() : bool
- Is unique group name
- isValidGroupName() : mixed
- next() : mixed
- Load next group
- setActiveStatus() : mixed
- setDescription() : mixed
- setDynamicPermissionIds() : mixed
- setHomepage() : mixed
- setName() : mixed
- setStaticPermissionIds() : mixed
- setType() : mixed
- setUsers() : void
- Set ID's of users which should belong to this group
- store() : bool
- Store user account
- loadUsers() : array<string|int, mixed>
- Returns an array of IDs of Users associated with this group
- storeUserAssociations() : bool
- Store user associations
- clean() : mixed
- load() : mixed
- loadDynamicPermissions() : mixed
- loadGroups() : mixed
- loadPermissions() : mixed
- loadStaticPermissions() : mixed
- parseFilterConditions() : mixed
- storePermissions() : mixed
Properties
$EOF
public
mixed
$EOF
$arrAttributes
private
mixed
$arrAttributes
= array('group_id', 'group_name', 'group_description', 'is_active', 'type', 'homepage')
$arrCache
private
mixed
$arrCache
= array()
$arrDynamicPermissions
private
mixed
$arrDynamicPermissions
$arrLoadedGroups
private
mixed
$arrLoadedGroups
= array()
$arrStaticPermissions
private
mixed
$arrStaticPermissions
$arrTypes
private
mixed
$arrTypes
= array('frontend', 'backend')
$arrUsers
`load()` initializes this as null. `loadUsers()` either returns an array or false.
private
array<string|int, mixed>|null|bool
$arrUsers
List of user IDs or null if not initialized or false on error
$defaultType
private
mixed
$defaultType
= 'frontend'
$description
private
mixed
$description
$error_msg
Contains the message if an error occurs
private
string
$error_msg
$homepage
private
mixed
$homepage
$id
private
mixed
$id
$is_active
private
mixed
$is_active
$name
private
mixed
$name
$type
private
mixed
$type
Methods
__construct()
public
__construct() : mixed
delete()
Deletes this group from DB
public
delete() : bool
Call $this->getErrorMsg()
to get the error message if this returns false
.
Return values
bool —True on success, false otherwise
first()
Load first group
public
first() : mixed
getActiveStatus()
public
getActiveStatus() : mixed
getAssociatedUserIds()
Returns a list of user IDs associated to this group
public
getAssociatedUserIds([bool $cache = true ]) : array<string|int, mixed>|false
Parameters
- $cache : bool = true
-
If set to false, does not load from cache nor update it
Return values
array<string|int, mixed>|false —List of user IDs or false on DB error
getDescription()
public
getDescription() : mixed
getDynamicPermissionIds()
public
getDynamicPermissionIds() : mixed
getErrorMsg()
public
getErrorMsg() : mixed
getGroup()
Returns the UserGroup for the given ID
public
getGroup(int $id) : UserGroup
Parameters
- $id : int
-
The UserGroup ID
Return values
UserGroup —The Group on success, false(?) otherwise
getGroupCount()
public
getGroupCount([mixed $arrFilter = null ]) : mixed
Parameters
- $arrFilter : mixed = null
getGroups()
public
getGroups([mixed $filter = null ][, mixed $arrSort = null ][, mixed $arrAttributes = null ][, mixed $limit = null ][, mixed $offset = 0 ]) : mixed
Parameters
- $filter : mixed = null
- $arrSort : mixed = null
- $arrAttributes : mixed = null
- $limit : mixed = null
- $offset : mixed = 0
getHomepage()
public
getHomepage() : mixed
getId()
public
getId() : mixed
getLoadedGroupCount()
public
getLoadedGroupCount() : mixed
getLoadedGroupIds()
public
getLoadedGroupIds() : mixed
getName()
public
getName() : mixed
getNameArray()
Returns an array of all available user group names, indexed by their ID
public
static getNameArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The user group name array
getStaticPermissionIds()
public
getStaticPermissionIds() : mixed
getType()
public
getType() : mixed
getTypes()
public
getTypes() : mixed
getUserCount()
public
getUserCount([mixed $onlyActive = false ]) : mixed
Parameters
- $onlyActive : mixed = false
isUniqueGroupName()
Is unique group name
public
isUniqueGroupName() : bool
Checks if the group name specified by $name is unique in the system.
Return values
boolisValidGroupName()
public
isValidGroupName() : mixed
next()
Load next group
public
next() : mixed
setActiveStatus()
public
setActiveStatus(mixed $status) : mixed
Parameters
- $status : mixed
setDescription()
public
setDescription(mixed $description) : mixed
Parameters
- $description : mixed
setDynamicPermissionIds()
public
setDynamicPermissionIds(mixed $arrPermissionIds) : mixed
Parameters
- $arrPermissionIds : mixed
setHomepage()
public
setHomepage(mixed $homepage) : mixed
Parameters
- $homepage : mixed
setName()
public
setName(mixed $name) : mixed
Parameters
- $name : mixed
setStaticPermissionIds()
public
setStaticPermissionIds(mixed $arrPermissionIds) : mixed
Parameters
- $arrPermissionIds : mixed
setType()
public
setType(mixed $type) : mixed
Parameters
- $type : mixed
setUsers()
Set ID's of users which should belong to this group
public
setUsers(array<string|int, mixed> $arrUsers) : void
Parameters
- $arrUsers : array<string|int, mixed>
Tags
store()
Store user account
public
store() : bool
This stores the metadata of the user, which includes the username, password, email, language ID, activ status and the administration status, to the database. If it is a new user, it also sets the registration time to the current time.
Tags
Return values
bool —True on success, false otherwise
loadUsers()
Returns an array of IDs of Users associated with this group
protected
loadUsers() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The array of User IDs on success, false otherwise
storeUserAssociations()
Store user associations
protected
storeUserAssociations() : bool
Stores the user associations of the loaded group.
Tags
Return values
bool —True on success, false otherwise
clean()
private
clean() : mixed
load()
private
load(mixed $id) : mixed
Parameters
- $id : mixed
loadDynamicPermissions()
private
loadDynamicPermissions() : mixed
loadGroups()
private
loadGroups([mixed $filter = null ][, mixed $arrSort = null ][, mixed $arrAttributes = null ][, mixed $limit = null ][, mixed $offset = 0 ]) : mixed
Parameters
- $filter : mixed = null
- $arrSort : mixed = null
- $arrAttributes : mixed = null
- $limit : mixed = null
- $offset : mixed = 0
loadPermissions()
private
loadPermissions(mixed $type) : mixed
Parameters
- $type : mixed
loadStaticPermissions()
private
loadStaticPermissions() : mixed
parseFilterConditions()
private
parseFilterConditions(mixed $arrFilter) : mixed
Parameters
- $arrFilter : mixed
storePermissions()
private
storePermissions() : mixed