\Horde_Prefs_Scope

This class provides the storage for a preference scope.

Summary

Methods
Properties
Constants
__construct()
remove()
set()
exists()
get()
setLocked()
isLocked()
isDefault()
getDefault()
getDirty()
isDirty()
setDirty()
current()
key()
next()
rewind()
valid()
serialize()
unserialize()
$init
$scope
No constants found
_fromInternal()
_toInternal()
$_dirty
$_prefs
N/A
No private methods found
No private properties found
N/A

Properties

$init

$init : boolean

Is the object being initialized?

Type

boolean

$scope

$scope : string

The scope name.

Type

string

$_dirty

$_dirty : array

List of dirty prefs.

Type

array

$_prefs

$_prefs : array

Preferences list. Each preference has the following format: <pre> [pref_name] => array( [d] => (string) Default value If not present, 'v' is the default value.

[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

Type

array

Methods

__construct()

__construct(string  $scope) 

Constructor.

Parameters

string $scope

The scope for this set of preferences.

remove()

remove(string  $pref) : boolean

Removes a preference entry.

Parameters

string $pref

The name of the preference to remove.

Returns

boolean —

True if preference was removed.

set()

set(string  $pref, string  $val) 

Sets the value for a preference.

Parameters

string $pref

The preference name.

string $val

The preference value.

exists()

exists(  $pref) : boolean

Does a preference exist in this scope?

Parameters

$pref

Returns

boolean —

True if the preference exists.

get()

get(string  $pref) : string

Returns the value of a preference.

Parameters

string $pref

The preference name to retrieve.

Returns

string —

The value of the preference, null if it doesn't exist.

setLocked()

setLocked(string  $pref, boolean  $locked) 

Mark a preference as locked.

Parameters

string $pref

The preference name.

boolean $locked

Is the preference locked?

isLocked()

isLocked(string  $pref) : boolean

Is a preference locked?

Parameters

string $pref

The preference name.

Returns

boolean —

Whether the preference is locked.

isDefault()

isDefault(string  $pref) : boolean

Is a preference's value the default?

Parameters

string $pref

The preference name.

Returns

boolean —

True if the preference contains the default value.

getDefault()

getDefault(string  $pref) : string

Returns the default value of a preference.

Parameters

string $pref

The preference name.

Returns

string —

The preference's default value.

getDirty()

getDirty() : array

Get the list of dirty preferences.

Returns

array —

The list of dirty preferences.

isDirty()

isDirty(mixed  $pref = null) : boolean

Is a preference marked dirty?

Parameters

mixed $pref

The preference name. If null, will return true if scope contains at least one dirty pref.

Returns

boolean —

True if the preference is marked dirty.

setDirty()

setDirty(string  $pref, boolean  $dirty) 

Set the dirty flag for a preference

Parameters

string $pref

The preference name.

boolean $dirty

True to mark the pref as dirty.

current()

current() 

key()

key() 

next()

next() 

rewind()

rewind() 

valid()

valid() 

serialize()

serialize() 

unserialize()

unserialize(  $data) 

Parameters

$data

_fromInternal()

_fromInternal(  $pref) 

Parameters

$pref

_toInternal()

_toInternal(  $pref, array  $value) 

Parameters

$pref
array $value