Class ClientGroups
	
	
		- 
			Model
			
			
			
		
- 
			 AppModel AppModel
- 
			 ClientGroups ClientGroups
Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize ClientGroups Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Add a client group using the supplied data 
				
Add a client group using the supplied data Parameters
						$varsarray$vars A single dimensional array of keys including: -name The name of this group
-description A description of this group (optional) -company_id The company ID
this group belongs to -color The HTML color that represents this group
(optional)
Returns
						integerThe client group ID created, or void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			edit( integer $client_group_id, array $vars )
				
Edit a client group using the supplied data 
				
Edit a client group using the supplied data Parameters
						$client_group_idinteger$client_group_id The ID of the group to be updated
$varsarray$vars A single dimensional array of keys including: -name The name of this group
-description A description of this group (optional) -company_id The company ID
this group belongs to -color The HTML color that represents this group
(optional)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $client_group_id )
				
Delete a client group and all associated client group settings 
				
Delete a client group and all associated client group settings Parameters
						$client_group_idinteger$client_group_id The ID for this client group
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getDefault( integer $company_id )
				
Finds the default client group for the given company. 
				
Finds the default client group for the given company. Parameters
						$company_idinteger$company_id
Returns
						mixedstdClass object representing the default client group, false if no such group
exists
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $client_group_id )
				
Returns the given client group 
				
Returns the given client group Parameters
						$client_group_idinteger$client_group_id The ID of the client group to fetch
Returns
						mixedA stdClass object representing the client group, false if it does not exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getList( integer $company_id, integer $page = 1, array $order_by = array('name'=>"ASC") )
				
Fetches a list of all client groups 
				
Fetches a list of all client groups Parameters
						$company_idinteger$company_id The company ID
$pageinteger$page The page to return results for (optional, default 1)
$order_bystring$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
						mixedAn array of objects or false if no results.
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getListCount( mixed $company_id )
				
Return the total number of client groups returned from
ClientGroups::getList(), useful in constructing pagination for the getList()
method. 
				
Return the total number of client groups returned from
ClientGroups::getList(), useful in constructing pagination for the getList()
method. Returns
						integerThe total number of clients
 
 See | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getAll( integer $company_id )
				
Fetches all custom client groups by company 
				
Fetches all custom client groups by company Parameters
						$company_idinteger$company_id The company ID to fetch client groups for
Returns
						mixedAn array of stdClass objects representing all client groups for the given
company
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSettings( integer $client_group_id, boolean $ignore_inheritence = false )
				
Fetch all settings that may apply to this client group. Settings are
inherited in the order of client_group_settings -> company_settings ->
settings where "->" represents the left item inheriting (and overwriting in
the case of duplicates) values found in the right item. 
				
Fetch all settings that may apply to this client group. Settings are
inherited in the order of client_group_settings -> company_settings ->
settings where "->" represents the left item inheriting (and overwriting in
the case of duplicates) values found in the right item. Parameters
						$client_group_idinteger$client_group_id The client group ID to retrieve settings for
$ignore_inheritenceboolean$ignore_inheritence True to fetch only client group settings without inheriting
from company or system settings (default false)
Returns
						mixedAn array of objects containg key/values for the settings, false if no records
found
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSetting( integer $client_group_id, string $key )
				
Fetch a specific setting that may apply to this client group. Settings are
inherited in the order of client_group_settings -> company_settings ->
settings where "->" represents the left item inheriting (and overwriting in
the case of duplicates) values found in the right item. 
				
Fetch a specific setting that may apply to this client group. Settings are
inherited in the order of client_group_settings -> company_settings ->
settings where "->" represents the left item inheriting (and overwriting in
the case of duplicates) values found in the right item. Parameters
						$client_group_idinteger$client_group_id The client group ID to retrieve settings for
$keystring$key The key name of the setting to fetch
Returns
						mixedA stdClass object containg key/values for the settings, false if no records
found
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSetting( integer $client_group_id, string $key, string $value, mixed $encrypted = null )
				
Add a client group setting, if duplicate then update the value 
				
Add a client group setting, if duplicate then update the value Parameters
						$client_group_idinteger$client_group_id The ID for the specified client group
$keystring$key The key for this client group setting
$valuestring$value The value for this client group setting
$encryptedmixed$encrypted True to encrypt $value, false to store unencrypted, null to encrypt
if currently set to encrypt
 | 
		
			| 
				 public 
				
				
				 | 
			#
			unsetSetting( integer $client_group_id, string $key )
				
Delete a client group setting 
				
Delete a client group setting Parameters
						$client_group_idinteger$client_group_id The ID for the specified client group
$keystring$key The key for this client group setting
 | 
		
			| 
				 public 
				
				
				 | 
			#
			unsetSettings( integer $client_group_id )
				
Deletes all client group settings 
				
Deletes all client group settings Parameters
						$client_group_idinteger$client_group_id The ID for the specified client group
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSettings( integer $client_group_id, array $vars, array $value_keys = null )
				
Add multiple client group settings, if duplicate then update the value 
				
Add multiple client group settings, if duplicate then update the value Parameters
						$client_group_idinteger$client_group_id The ID for the specified client group
$varsarray$vars A single dimensional array of key/value pairs of settings
$value_keysarray$value_keys An array of key values to accept as valid fields
 | 
		
		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