Methods summary
public
|
#
__construct( )
Initialize Staff Groups
Overrides
|
public
integer
|
#
add( array $vars )
Adds a new staff group
Parameters
- $vars
An array of staff group information including:
- company_id The company ID
- name The name of this staff group
- session_lock Set whether or not the IP set for the session must match the user's IP
- notices An array of email group actions representing BCC notices available to this group
- permission_group A numerically indexed array of permission group IDs to allow access to
- permission A numerically indexed array of permission field IDs to allow access to
Returns
integer The staff group ID created, void on error
See
|
public
integer
|
#
edit( integer $staff_group_id, array $vars )
Updates a staff group
Parameters
- $staff_group_id
- The staff group ID
- $vars
An array of staff group information including:
- company_id The company ID
- name The name of this staff group
- session_lock Set whether or not the IP set for the session must match the user's IP
- notices An array of email group actions representing BCC notices available to this group
- permission_group A numerically indexed array of permission group IDs to allow access to
- permission A numerically indexed array of permission field IDs to allow access to
Returns
integer The staff group ID created, void on error
See
|
public
|
#
delete( integer $staff_group_id )
Deletes a staff group
Parameters
- $staff_group_id
- The staff group ID
|
public
|
#
grantPermission( integer $staff_group_id, integer $plugin_id )
Grant access to every permission allowed by the given plugin to the given staff group
Grant access to every permission allowed by the given plugin to the given staff group
Parameters
- $staff_group_id
- The staff group ID to grant access for
- $plugin_id
- The ID of the plugin to grant access to
|
public
integer
|
#
cloneGroup( integer $staff_group_id, integer $company_id )
Clone an existing staff group to the given company
Clone an existing staff group to the given company
Parameters
- $staff_group_id
- The ID of the staff group to clone
- $company_id
- The ID of the company to assign the cloned staff group to
Returns
integer The ID of the new staff group
|
public
|
#
addNotice( array $vars )
Adds a staff group notice
Adds a staff group notice
Parameters
- $vars
An array of staff group information including:
- staff_group_id The ID of the staff group this notice will be added to
- action The email group action
|
public
|
#
deleteNotice( integer $staff_group_id, string $action = null )
Deletes the given staff group notice
Deletes the given staff group notice
Parameters
- $staff_group_id
- The ID of the staff group the notice belongs to
- $action
- The email group action to remove (optional, default null to delete all notices)
|
public
mixed
|
#
get( integer $staff_group_id )
Fetches a staff group
Parameters
- $staff_group_id
- The staff group ID to fetch
Returns
mixed An array of stdClass objects representing the staff group, false if it does not exist
|
public
mixed
|
#
getAll( integer $company_id = null )
Fetches all staff groups belonging to a given company, or all companies if not given
Fetches all staff groups belonging to a given company, or all companies if not given
Parameters
- $company_id
- The ID of the company whose staff groups to fetch (optional, default null)
Returns
mixed An array of stdClass objects representing the staff groups of a company, or false if none exist
|
public
array
|
#
getUsersGroups( integer $user_id )
Fetch all groups and companies this staff user is associated with
Fetch all groups and companies this staff user is associated with
Parameters
- $user_id
- The ID of the user to fetch staff group info for
Returns
array An array of stdClass objects representing a particular staff group/staff member association
|
public
stdClass
|
#
getStaffGroupByStaff( integer $staff_id, integer $company_id )
Fetches the staff group for the given staff member and company
Fetches the staff group for the given staff member and company
Parameters
- $staff_id
- The ID of the staff member to fetch the group for
- $company_id
- The ID of the company to fetch the staff group for
Returns
stdClass A stdClass representation of the staff group
|
public
mixed
|
#
getList( integer $company_id, integer $page = 1, string $order_by = ['name' => 'ASC'] )
Retrieves a list of plugins installed under a particular company
Retrieves a list of plugins installed under a particular company
Parameters
- $company_id
- The company ID
- $page
- The page of results to fetch (optional, default 1)
- $order_by
- The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
Returns
mixed An array of stdClass objects representing staff groups, or false if none exist
|
public
integer
|
#
getListCount( integer $company_id )
Returns the total number of staff groups returned from StaffGroups::getList(),
useful in constructing pagination for the getList() method.
Returns the total number of staff groups returned from StaffGroups::getList(),
useful in constructing pagination for the getList() method.
Parameters
- $company_id
- The company ID
Returns
integer The total number of staff groups
See
|
public
array
|
#
getNotices( integer $staff_group_id )
Fetches all staff group notices
Fetches all staff group notices
Parameters
- $staff_group_id
- The ID of the staff group
Returns
array A list of all staff group notices
|