Documentation

UserGroup
in package

User Group Object

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Cloudrexx Development Team info@cloudrexx.com

version
1.0.0
subpackage

lib_framework

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
parseSearchConditions()  : array<string|int, mixed>
Builds SQL WHERE conditions for searching groups.
storeUserAssociations()  : bool
Store user associations
clean()  : mixed
load()  : mixed
loadDynamicPermissions()  : mixed
loadGroups()  : mixed
loadPermissions()  : mixed
loadStaticPermissions()  : mixed
parseFilterConditions()  : mixed
storePermissions()  : mixed

Properties

$arrAttributes

private mixed $arrAttributes = array('group_id', 'group_name', 'group_description', 'is_active', 'type', 'homepage')

$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

$error_msg

Contains the message if an error occurs

private string $error_msg

Methods

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

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

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 ][, array<string|int, mixed> $search = [] ]) : mixed
Parameters
$filter : mixed = null
$arrSort : mixed = null
$arrAttributes : mixed = null
$limit : mixed = null
$offset : mixed = 0
$search : array<string|int, mixed> = []

getNameArray()

Returns an array of all available user group names, indexed by their ID

public static getNameArray() : array<string|int, mixed>
Tags
author

Reto Kohli reto.kohli@comvation.com

Return values
array<string|int, mixed> —

The user group name array

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
bool

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
see
User
User::getUser()

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
global

ADONewConnection

array

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
global

ADOConnection $objDatabase

Return values
array<string|int, mixed> —

The array of User IDs on success, false otherwise

parseSearchConditions()

Builds SQL WHERE conditions for searching groups.

protected parseSearchConditions(array<string|int, mixed> $search) : array<string|int, mixed>

Iterates through the provided search terms and applies them against predefined attributes (group_name, group_description).

Example: Input: ['test', 'demo'] Output (array form): [ "tblG.group_name LIKE "%test%" AND tblG.group_name LIKE "%demo%"", "tblG.group_description LIKE "%test%" AND tblG.group_description LIKE "%demo%"" ]

Parameters
$search : array<string|int, mixed>

List of search strings to filter by.

Return values
array<string|int, mixed> —

A list of SQL condition strings to be combined externally.

storeUserAssociations()

Store user associations

protected storeUserAssociations() : bool

Stores the user associations of the loaded group.

Tags
global

ADONewConnection

throws
Exception

User event listeners might throw exceptions

Return values
bool —

True on success, false otherwise

loadGroups()

private loadGroups([mixed $filter = null ][, mixed $arrSort = null ][, mixed $arrAttributes = null ][, mixed $limit = null ][, mixed $offset = 0 ][, array<string|int, mixed> $search = [] ]) : mixed
Parameters
$filter : mixed = null
$arrSort : mixed = null
$arrAttributes : mixed = null
$limit : mixed = null
$offset : mixed = 0
$search : array<string|int, mixed> = []

loadPermissions()

private loadPermissions(mixed $type) : mixed
Parameters
$type : mixed

parseFilterConditions()

private parseFilterConditions(mixed $arrFilter) : mixed
Parameters
$arrFilter : mixed
On this page

Search results