Horde_Prefs_Scope
in package
implements
Iterator, Serializable, JsonSerializable
This class provides the storage for a preference scope.
Tags
Interfaces, Classes, Traits and Enums
- Iterator
- Serializable
- JsonSerializable
Table of Contents
- $init : bool
- Is the object being initialized?
- $scope : string
- The scope name.
- $_dirty : array<string|int, mixed>
- List of dirty prefs.
- $_prefs : array<string|int, mixed>
- Preferences list. Each preference has the following format: <pre> [pref_name] => array( [d] => (string) Default value If not present, 'v' is the default value.
- __construct() : mixed
- Constructor.
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- current() : mixed
- exists() : bool
- Does a preference exist in this scope?
- get() : string
- Returns the value of a preference.
- getDefault() : string
- Returns the default value of a preference.
- getDirty() : array<string|int, mixed>
- Get the list of dirty preferences.
- isDefault() : bool
- Is a preference's value the default?
- isDirty() : bool
- Is a preference marked dirty?
- isLocked() : bool
- Is a preference locked?
- jsonSerialize() : string
- key() : mixed
- next() : mixed
- remove() : bool
- Removes a preference entry.
- rewind() : mixed
- serialize() : mixed
- set() : mixed
- Sets the value for a preference.
- setDirty() : mixed
- Set the dirty flag for a preference
- setLocked() : mixed
- Mark a preference as locked.
- unserialize() : mixed
- valid() : mixed
- _fromInternal() : mixed
- _toInternal() : mixed
Properties
$init
Is the object being initialized?
public
bool
$init
= \false
$scope
The scope name.
public
string
$scope
$_dirty
List of dirty prefs.
protected
array<string|int, mixed>
$_dirty
= array()
$_prefs
Preferences list. Each preference has the following format: <pre> [pref_name] => array( [d] => (string) Default value If not present, 'v' is the default value.
protected
array<string|int, mixed>
$_prefs
= array()
[l] => (boolean) Locked If not present, pref is not locked. [v] => (string) Current pref value )
For internal storage, if 'l' and 'v' are both not available: [pref_name] => (string) Current pref value
Methods
__construct()
Constructor.
public
__construct(string $scope) : mixed
Parameters
- $scope : string
-
The scope for this set of preferences.
Return values
mixed —__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Return values
void —current()
public
current() : mixed
Return values
mixed —exists()
Does a preference exist in this scope?
public
exists(mixed $pref) : bool
Parameters
- $pref : mixed
Return values
bool —True if the preference exists.
get()
Returns the value of a preference.
public
get(string $pref) : string
Parameters
- $pref : string
-
The preference name to retrieve.
Return values
string —The value of the preference, null if it doesn't exist.
getDefault()
Returns the default value of a preference.
public
getDefault(string $pref) : string
Parameters
- $pref : string
-
The preference name.
Return values
string —The preference's default value.
getDirty()
Get the list of dirty preferences.
public
getDirty() : array<string|int, mixed>
Return values
array<string|int, mixed> —The list of dirty preferences.
isDefault()
Is a preference's value the default?
public
isDefault(string $pref) : bool
Parameters
- $pref : string
-
The preference name.
Return values
bool —True if the preference contains the default value.
isDirty()
Is a preference marked dirty?
public
isDirty([mixed $pref = null ]) : bool
Parameters
- $pref : mixed = null
-
The preference name. If null, will return true if scope contains at least one dirty pref.
Return values
bool —True if the preference is marked dirty.
isLocked()
Is a preference locked?
public
isLocked(string $pref) : bool
Parameters
- $pref : string
-
The preference name.
Return values
bool —Whether the preference is locked.
jsonSerialize()
public
jsonSerialize() : string
Return values
string —key()
public
key() : mixed
Return values
mixed —next()
public
next() : mixed
Return values
mixed —remove()
Removes a preference entry.
public
remove(string $pref) : bool
Parameters
- $pref : string
-
The name of the preference to remove.
Return values
bool —True if preference was removed.
rewind()
public
rewind() : mixed
Return values
mixed —serialize()
public
serialize() : mixed
Return values
mixed —set()
Sets the value for a preference.
public
set(string $pref, string $val) : mixed
Parameters
- $pref : string
-
The preference name.
- $val : string
-
The preference value.
Return values
mixed —setDirty()
Set the dirty flag for a preference
public
setDirty(string $pref, bool $dirty) : mixed
Parameters
- $pref : string
-
The preference name.
- $dirty : bool
-
True to mark the pref as dirty.
Return values
mixed —setLocked()
Mark a preference as locked.
public
setLocked(string $pref, bool $locked) : mixed
Parameters
- $pref : string
-
The preference name.
- $locked : bool
-
Is the preference locked?
Return values
mixed —unserialize()
public
unserialize(mixed $data) : mixed
Parameters
- $data : mixed
Return values
mixed —valid()
public
valid() : mixed
Return values
mixed —_fromInternal()
protected
_fromInternal(mixed $pref) : mixed
Parameters
- $pref : mixed
Return values
mixed —_toInternal()
protected
_toInternal(mixed $pref, array<string|int, mixed> $value) : mixed
Parameters
- $pref : mixed
- $value : array<string|int, mixed>