Effective setting manager class.
Provides a interface to retrieve effective
settings.
Requested effective settings will be cached at first time. Further requests
will
return cached settings.
The order to retrieve a effective setting is:
System => Client => Client (language) => Group => User
- System properties can be overridden by the client
- Client properties can be overridden by client language
- Client language properties can be overridden by group
- Group properties can be overridden by user
Methods summary
public static
boolean|string
|
#
get( string $type, string $name, string $default = '' )
Returns effective setting for a property.
Returns effective setting for a property.
The order is: System => Client => Client (language) => Group => User
System properties can be overridden by the group, and group properties
can be overridden by the user.
NOTE: If you provide a default value (other than empty string), then it will be returned back in case of not existing or empty setting.
Parameters
- $type
- The type of the item
- $name
- The name of the item
- $default
- Optional default value
Returns
boolean|string Setting value or false
|
public static
array
|
#
getByType( string $type )
Returns effective setting for a type of properties.
Caches also the collected settings, but contrary to get() it returns
never cached entries.
Returns effective setting for a type of properties.
Caches also the collected settings, but contrary to get() it returns
never cached entries.
The order is:
System => Client => Client (language) => Group => User
System properties can be overridden by the group, and group
properties can be overridden by the user.
Parameters
- $type
- The type of the item
Returns
array Assoziative array like $arr[name] = value
|
public static
|
#
set( string $type, string $name, string $value )
Sets a effective setting.
Sets a effective setting.
Note:
The setting will be set only in cache, not in persistency layer.
Parameters
- $type
- The type of the item
- $name
- The name of the item
- $value
- The value of the setting
|
public static
|
#
delete( string $type, string $name )
Deletes a effective setting.
Deletes a effective setting.
Note:
The setting will be deleted only from cache, not from persistency layer.
Parameters
- $type
- The type of the item
- $name
- The name of the item
|
public static
|
#
reset( )
Resets all properties of the effective settings class.
Usable to start getting settings from scratch.
Resets all properties of the effective settings class.
Usable to start getting settings from scratch.
|
protected static
cApiUser
|
#
_getUserInstance( )
Returns the user object instance.
Returns the user object instance.
Returns
|
protected static
cApiClientLanguage
|
|
protected static
cApiLanguage
|
#
_getLanguageInstance( )
Returns the language object instance.
Returns the language object instance.
Returns
|
protected static
cApiClient
|
#
_getClientInstance( )
Returns the client language object instance.
Returns the client language object instance.
Returns
|
protected static
string
|
#
_get( string $key )
Setting getter.
Parameters
Returns
string bool setting value or false
|
protected static
|
#
_set( string $key, string $value )
Setting setter.
Parameters
- $key
- The setting key
- $value
- Value to store
|
protected static
string
|
#
_makeKey( string $type, string $name )
Setting key getter.
Parameters
- $type
- The type of the item
- $name
- Name of the item
Returns
string The setting key
|
protected static
boolean
|
#
_isAuthenticated( )
Checks global authentication object and if current user is authenticated.
Checks global authentication object and if current user is authenticated.
Returns
boolean
|