UserGroupsHelper

Helper to deal with user groups.

final
since

3.6.3

Methods

__construct

Constructor

__construct(array $groups = array(), integer $mode = self::MODE_INSTANCE) 
since

3.6.3

Arguments

$groups

arrayArray of groups

$mode

integerWorking 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

integerGroup identifier

Response

mixedstdClass 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
static
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

integerGroup 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

integerGroup 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

\stdClassGroup

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

arrayArray of user groups.

Response

self

total

Get total available user groups in database.

total() : integer
since

3.6.3

Response

integer

Constants

MODE_SINGLETON

const

integer

since

3.6.3

MODE_INSTANCE

const

integer

since

3.6.3

Properties

instance

Singleton instance.

static
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