Class StaffGroups
	
	
		- 
			Model
			
			
			
		
- 
			 AppModel AppModel
- 
			 StaffGroups StaffGroups
Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize Staff Groups Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Adds a new staff group Parameters
						$varsarray$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
						integerThe staff group ID created, void on error
 
 See | 
		
			| 
				 public 
				integer
				
				 | 
			#
			edit( integer $staff_group_id, array $vars )
				
Updates a staff group Parameters
						$staff_group_idinteger$staff_group_id The staff group ID
$varsarray$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
						integerThe staff group ID created, void on error
 
 See | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $staff_group_id )
				
Deletes a staff group Parameters
						$staff_group_idinteger$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_idinteger$staff_group_id The staff group ID to grant access for
$plugin_idinteger$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_idinteger$staff_group_id The ID of the staff group to clone
$company_idinteger$company_id The ID of the company to assign the cloned staff group to
Returns
						integerThe ID of the new staff group
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			addNotice( array $vars )
				
Adds a staff group notice 
				
Adds a staff group notice Parameters
						$varsarray$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_idinteger$staff_group_id The ID of the staff group the notice belongs to
$actionstring$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_idinteger$staff_group_id The staff group ID to fetch
Returns
						mixedAn 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_idinteger$company_id The ID of the company whose staff groups to fetch (optional, default
null)
Returns
						mixedAn 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_idinteger$user_id The ID of the user to fetch staff group info for
Returns
						arrayAn 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_idinteger$staff_id The ID of the staff member to fetch the group for
$company_idinteger$company_id The ID of the company to fetch the staff group for
Returns
						stdClassA stdClass representation of the staff group
					 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getList( integer $company_id, integer $page = 1, string $order_by = array('name'=>"ASC") )
				
Retrieves a list of plugins installed under a particular company 
				
Retrieves a list of plugins installed under a particular company Parameters
						$company_idinteger$company_id The company ID
$pageinteger$page The page of results to fetch (optional, default 1)
$order_bystring$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
						mixedAn 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_idinteger$company_id The company ID
Returns
						integerThe 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_idinteger$staff_group_id The ID of the staff group
Returns
						arrayA list of all staff group notices
 
 | 
		
		Methods inherited from AppModel
		
			_(), 
			boolToInt(), 
			currencyToDecimal(), 
			dateToUtc(), 
			errors(), 
			getPerPage(), 
			ifSet(), 
			loadCrypto(), 
			setDefaultIfEmpty(), 
			setPerPage(), 
			setRulesIfSet(), 
			strToBool(), 
			systemDecrypt(), 
			systemEncrypt(), 
			systemHash(), 
			truncateDecimal(), 
			validateExists(), 
			validateStateCountry()
		
		Methods inherited from Model
		
			affectedRows(), 
			begin(), 
			commit(), 
			getConnection(), 
			lastInsertId(), 
			makeDSN(), 
			prepare(), 
			query(), 
			rollBack(), 
			setAttribute(), 
			setFetchMode()
		
		Magic methods summary
		Properties summary
		Properties inherited from AppModel
		
			$replacement_keys