Class SettingsCollection
A collection manager of company settings
Methods summary
public
|
|
public
array
|
#
fetchSettings( Companies $companies = null, integer $company_id = null, boolean $ignore_inheritence = false )
Fetches all settings that apply to this company. Settings are inherited in
the order of company_settings -> settings where "->" represents the left
item inheriting (and overwriting in the case of duplicates) values found in the
right item.
Fetches all settings that apply to this company. Settings are inherited in
the order of company_settings -> settings where "->" represents the left
item inheriting (and overwriting in the case of duplicates) values found in the
right item.
Parameters
- $companies
Companies
$companies A reference to the Companies model object
- $company_id
integer $company_id The company ID to retrieve settings for
- $ignore_inheritence
boolean $ignore_inheritence True to only retrieve company settings, false to get all
inherited settings (default false)
Returns
array A key=>value array of company settings
|
public
array
|
#
fetchSetting( Companies $companies = null, string $company_id = null, mixed $key = null )
Fetches a specific setting that apply to this company. Settings are inherited
in the order of company_settings -> settings where "->" represents the
left item inheriting (and overwriting in the case of duplicates) values found in
the right item.
Fetches a specific setting that apply to this company. Settings are inherited
in the order of company_settings -> settings where "->" represents the
left item inheriting (and overwriting in the case of duplicates) values found in
the right item.
Parameters
- $companies
integer $company_id The company ID to retrieve a setting for
- $company_id
string $key The key name of the setting to fetch
- $key
Returns
array containing the key and value for this setting
|
public
array
|
#
fetchSystemSettings( Settings $settings = null )
Fetches all system settings.
Fetches all system settings.
Parameters
- $settings
Settings
$settings A reference to the Settings model object
Returns
array A key=>value array of system settings
|
public
array
|
#
fetchSystemSetting( Settings $settings = null, string $key = null )
Fetches a specific system setting.
Fetches a specific system setting.
Parameters
- $settings
Settings
$settings A reference to the Settings model object
- $key
string $key The key name of the setting to fetch
Returns
array containing the key and value for this setting
|
public
array
|
#
fetchClientGroupSettings( integer $client_group_id, ClientGroups $settings = null, boolean $ignore_inheritence = false )
Fetches all client group settings for a particular group
Fetches all client group settings for a particular group
Parameters
- $client_group_id
integer $client_group_id The client group ID to fetch settings for
- $settings
ClientGroups
$settings A reference to the ClientGroups model object
- $ignore_inheritence
boolean $ignore_inheritence True to fetch only client group settings without inheriting
from company or system settings (default false)
Returns
array A key=>value array of client group settings
|
public
array
|
#
fetchClientGroupSetting( integer $client_group_id, ClientGroups $settings = null, string $key = null )
Fetches a specific ClientGroup setting.
Fetches a specific ClientGroup setting.
Parameters
- $client_group_id
integer $client_group_id The client group ID to fetch a setting for
- $settings
ClientGroups
$settings A reference to the ClientGroups model object
- $key
string $key The key name of the setting to fetch
Returns
array containing the key and value for this setting
|
public
array
|
#
fetchClientSettings( integer $client_id, Clients $settings = null )
Fetches all client settings for a particular client
Fetches all client settings for a particular client
Parameters
- $client_id
integer $client_id The client ID to fetch settings for
- $settings
Clients
$settings A reference to the Clients model object
Returns
array A key=>value array of client group settings
|
public
array
|
#
fetchClientSetting( integer $client_id, Clients $settings = null, string $key = null )
Fetches a specific Client setting.
Fetches a specific Client setting.
Parameters
- $client_id
integer $client_id The client group ID to fetch a setting for
- $settings
Clients
$settings A reference to the Clients model object
- $key
string $key The key name of the setting to fetch
Returns
array containing the key and value for this setting
|
private
object
|
#
loadIfNotSet( mixed $obj, string $model )
Loads the given model if nothing passed into $obj
Loads the given model if nothing passed into $obj
Parameters
- $obj
mixed $obj The model object to be used, null to initialize the model using $model
instead.
- $model
string $model The name of the model to initialize if $obj is not given
Returns
object The model object specified by $obj or created using $model if not specified.
|
Magic methods summary