GroupOperations View code

A singleton Class for doing group related functions.

Many of the Group object functions are just wrappers around these.

since 0.6
package

CMS

license

GPL

Methods

get_instance() : \GroupOperations

Retrieve the single instance of this class

static

Response

\GroupOperations

LoadGroups() : array

Loads all the groups from the database and returns them

Response

array

The list of groups

LoadGroupByID(integer $id) : mixed

Load a group from the database by its id

deprecated

Arguments

integer $id

The id of the group to load

Response

mixed

The group if found. If it's not found, then false

InsertGroup(mixed $group) : integer

Given a group object, inserts it into the database.

deprecated

Arguments

mixed $group

The group object to save to the database

Response

integer

The id of the newly created group. If none is created, -1

UpdateGroup(mixed $group) : boolean

Given a group object, update its attributes in the database.

deprecated

Arguments

mixed $group

The group to update

Response

boolean

True if the update was successful, false if not

DeleteGroupByID(integer $id) : boolean

Given a group id, delete it from the database along with all its associations.

deprecated

Arguments

integer $id

The group's id to delete

Response

boolean

True if the delete was successful. False if not.

CheckPermission(integer $groupid, string $perm) : boolean

Test if a group has the specified permission

Arguments

integer $groupid

The group id

string $perm

The permission name

Response

boolean

GrantPermission(integer $groupid, string $perm) 

Grant a permission to a group

Arguments

integer $groupid

The group id

string $perm

The permission name

RemovePermission(integer $groupid, string $perm) 

De-associate the specified permission with the group

Arguments

integer $groupid

The group id

string $perm

The permission name