PHP Class Horde_Prefs_Scope, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements Iterator, implements Serializable
显示文件 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$init boolean Is the object being initialized?
$scope string The scope name.

Protected Properties

Property Type Description
$_dirty array List of dirty prefs.
$_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

Public Methods

Method Description
__construct ( string $scope ) Constructor.
current ( )
exists ( $pref ) : boolean Does a preference exist in this scope?
get ( string $pref ) : string Returns the value of a preference.
getDefault ( string $pref ) : string Returns the default value of a preference.
getDirty ( ) : array Get the list of dirty preferences.
isDefault ( string $pref ) : boolean Is a preference's value the default?
isDirty ( mixed $pref = null ) : boolean Is a preference marked dirty?
isLocked ( string $pref ) : boolean Is a preference locked?
key ( )
next ( )
remove ( string $pref ) : boolean Removes a preference entry.
rewind ( )
serialize ( )
set ( string $pref, string $val ) Sets the value for a preference.
setDirty ( string $pref, boolean $dirty ) Set the dirty flag for a preference
setLocked ( string $pref, boolean $locked ) Mark a preference as locked.
unserialize ( $data )
valid ( )

Protected Methods

Method Description
_fromInternal ( $pref )
_toInternal ( $pref, array $value )

Method Details

__construct() public method

Constructor.
public __construct ( string $scope )
$scope string The scope for this set of preferences.

_fromInternal() protected method

protected _fromInternal ( $pref )

_toInternal() protected method

protected _toInternal ( $pref, array $value )
$value array

current() public method

public current ( )

exists() public method

Does a preference exist in this scope?
public exists ( $pref ) : boolean
return boolean True if the preference exists.

get() public method

Returns the value of a preference.
public get ( string $pref ) : string
$pref string The preference name to retrieve.
return string The value of the preference, null if it doesn't exist.

getDefault() public method

Returns the default value of a preference.
public getDefault ( string $pref ) : string
$pref string The preference name.
return string The preference's default value.

getDirty() public method

Get the list of dirty preferences.
public getDirty ( ) : array
return array The list of dirty preferences.

isDefault() public method

Is a preference's value the default?
public isDefault ( string $pref ) : boolean
$pref string The preference name.
return boolean True if the preference contains the default value.

isDirty() public method

Is a preference marked dirty?
public isDirty ( mixed $pref = null ) : boolean
$pref mixed The preference name. If null, will return true if scope contains at least one dirty pref.
return boolean True if the preference is marked dirty.

isLocked() public method

Is a preference locked?
public isLocked ( string $pref ) : boolean
$pref string The preference name.
return boolean Whether the preference is locked.

key() public method

public key ( )

next() public method

public next ( )

remove() public method

Removes a preference entry.
public remove ( string $pref ) : boolean
$pref string The name of the preference to remove.
return boolean True if preference was removed.

rewind() public method

public rewind ( )

serialize() public method

public serialize ( )

set() public method

Sets the value for a preference.
public set ( string $pref, string $val )
$pref string The preference name.
$val string The preference value.

setDirty() public method

Set the dirty flag for a preference
public setDirty ( string $pref, boolean $dirty )
$pref string The preference name.
$dirty boolean True to mark the pref as dirty.

setLocked() public method

Mark a preference as locked.
public setLocked ( string $pref, boolean $locked )
$pref string The preference name.
$locked boolean Is the preference locked?

unserialize() public method

public unserialize ( $data )

valid() public method

public valid ( )

Property Details

$_dirty protected_oe property

List of dirty prefs.
protected array $_dirty
return array

$_prefs protected_oe property

[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
protected array $_prefs
return array

$init public_oe property

Is the object being initialized?
public bool $init
return boolean

$scope public_oe property

The scope name.
public string $scope
return string