Свойство | Тип | Описание | |
---|---|---|---|
$_cache | Horde_Prefs_Cache | Caching object. | |
$_opts | array | General library options. | |
$_scope | string | String containing the name of the current scope. This is used to differentiate between sets of preferences. By default, preferences belong to this scope. | |
$_scopes | array | Scope list. Keys are scope names, values are Horde_Prefs_Scope objects. | |
$_storage | array | The storage driver(s). |
Метод | Описание | |
---|---|---|
__construct ( string $scope, mixed $storage = null, array $opts = [] ) | Constructor. | |
__get ( $name ) | Shortcut to getValue(). | |
__set ( $name, $value ) | Shortcut to setValue(). | |
changeScope ( string $scope ) | Changes the current preference scope. | |
cleanup ( boolean $all = false ) | Cleanup (e.g. remove) scope(s). | |
getCache ( ) : Horde_Prefs_Cache_Base | Return the cache object. | |
getDefault ( string $pref ) : string | Returns the default value of the given preference. | |
getScope ( ) : string | Get the current scope. | |
getStorage ( ) : array | Returns the storage drivers. | |
getUser ( ) : string | Return the user who owns these preferences. | |
getValue ( string $pref ) : string | Returns the value of the requested preference. | |
isDefault ( string $pref ) : boolean | Determines if the current preference value is the default value. | |
isDirty ( string $pref ) : boolean | Is a preference marked dirty? | |
isLocked ( string $pref ) : boolean | Is a preference locked? | |
offsetExists ( $offset ) | * ArrayAccess methods. | |
offsetGet ( $offset ) | ||
offsetSet ( $offset, $value ) | ||
offsetUnset ( $offset ) | ||
remove ( string $pref = null ) | Removes a preference entry from the $prefs hash. | |
removeAll ( ) | Removes all preference entries for the current user from the $prefs hash and the backends. | |
retrieve ( string $scope = null ) | Retrieves preferences for the current scope. | |
setLocked ( string $pref, $bool ) | Mark a preference as locked. | |
setValue ( string $pref, string $val, array $opts = [] ) : boolean | Sets the given preference to the specified value if the preference is modifiable. | |
store ( boolean $throw = true ) | Save all dirty prefs to the storage backend. |
Метод | Описание | |
---|---|---|
_getScope ( string $pref ) : mixed | Returns the scope of a preference. | |
_loadScope ( string $scope ) | Load a specific preference scope. |
public __construct ( string $scope, mixed $storage = null, array $opts = [] ) | ||
$scope | string | The scope for this set of preferences. |
$storage | mixed | The storage object(s) to use. Either a single Horde_Prefs_Storage object, or an array of objects. |
$opts | array | Additional confguration options:
cache - (Horde_Prefs_Cache) The cache driver to use. DEFAULT: No caching. logger - (Horde_Log_Logger) Logging object. DEFAULT: NONE sizecallback - (callback) If set, called when setting a value in the backend. DEFAULT: NONE user - (string) The name of the user who owns this set of preferences. DEFAULT: NONE |
protected _loadScope ( string $scope ) | ||
$scope | string | The scope to load. |
public changeScope ( string $scope ) | ||
$scope | string | Scope specifier. |
public getCache ( ) : Horde_Prefs_Cache_Base | ||
Результат | Horde_Prefs_Cache_Base | Cache object. |
public getDefault ( string $pref ) : string | ||
$pref | string | The name of the preference to get the default for. |
Результат | string | The preference's default value. |
public getStorage ( ) : array | ||
Результат | array | The storage drivers. |
public removeAll ( ) |
public setValue ( string $pref, string $val, array $opts = [] ) : boolean | ||
$pref | string | The preference name to modify. |
$val | string | The preference value (UTF-8). |
$opts | array | Additional options:
- force: (boolean) If true, will set the value disregarding the current locked status of the pref. (@since 2.5.0) DEFAULT: false - nosave: (boolean) If true, the preference will not be saved to the storage backend(s). DEFAULT: false |
Результат | boolean | True if the value was successfully set, false on a failure. |
protected Horde_Prefs_Cache $_cache | ||
Результат | Horde_Prefs_Cache |
protected string $_scope | ||
Результат | string |
protected array $_scopes | ||
Результат | array |