UserGroupsHelper
Helper to deal with user groups.
since |
3.6.3 |
---|
Methods
__construct
Constructor
__construct(array $groups = array(), integer $mode = self::MODE_INSTANCE)
since |
3.6.3 |
---|
Arguments
- $groups
array
Array of groups- $mode
integer
Working mode for this class
count
Count loaded user groups.
count() : integer
since |
3.6.3 |
---|
Response
integer
get
Get a user group by its id.
get(integer $id) : mixed
since |
3.6.3 |
---|
Arguments
- $id
integer
Group identifier
Response
mixed
stdClass on success. False otherwise
getAll
Get the list of existing user groups.
getAll() : array
since |
3.6.3 |
---|
Response
array
getInstance
Get the helper instance.
getInstance() : self
since |
3.6.3 |
---|
Response
self
has
Check if a group is in the list.
has(integer $id) : boolean
since |
3.6.3 |
---|
Arguments
- $id
integer
Group identifier
Response
boolean
isSingleton
Check if this instance is a singleton.
isSingleton() : boolean
since |
3.6.3 |
---|
Response
boolean
load
Load a group from database.
load(integer $id) : mixed
since |
3.6.3 |
---|
Arguments
- $id
integer
Group identifier
Response
mixed
loadAll
Load all user groups from the database.
loadAll() : self
since |
3.6.3 |
---|
Response
self
populateGroupData
Populate data for a specific user group.
populateGroupData(\stdClass $group) : \stdClass
since |
3.6.3 |
---|
Arguments
- $group
\stdClass
Group
Response
\stdClass
populateGroupsData
Populates extra information for groups.
populateGroupsData() : array
since |
3.6.3 |
---|
Response
array
setGroups
Set the groups to be used as source.
setGroups(array $groups) : self
since |
3.6.3 |
---|
Arguments
- $groups
array
Array of user groups.
Response
self
total
Get total available user groups in database.
total() : integer
since |
3.6.3 |
---|
Response
integer
Constants
MODE_SINGLETON
Indicates the current helper instance is the singleton instance.
Value | 1 |
---|---|
since |
3.6.3 |
Type(s)
integer
MODE_INSTANCE
Indicates the current helper instance is a standalone class instance.
Value | 2 |
---|---|
since |
3.6.3 |
Type(s)
integer
Properties
instance
Singleton instance.
since |
3.6.3 |
---|
Type(s)
array
groups
Available user groups
since |
3.6.3 |
---|
Type(s)
array
mode
Mode this class is working: singleton or std instance
since |
3.6.3 |
---|
Type(s)
integer
total
Total available groups
since |
3.6.3 |
---|
Type(s)
integer