\Horde_Prefs_Storage_KolabImap

Preferences storage implementation for a Kolab IMAP server.

Summary

Methods
Properties
Constants
__construct()
getParams()
get()
store()
onChange()
remove()
listScopes()
No public properties found
No constants found
_getStorage()
$_params
$_kolab
$_folder
$_logger
N/A
_prefToArray()
_arrayToPref()
_logMissingStorage()
_logMissingScope()
No private properties found
N/A

Properties

$_params

$_params : string

Configuration parameters.

'user' is always available as an entry.

Type

string

$_kolab

$_kolab : \Horde_Kolab_Storage

Handle for the current Kolab connection.

Type

\Horde_Kolab_Storage

$_folder

$_folder : string

Name of the preferences default folder

Type

string

$_logger

$_logger : \Horde_Log_Logger

Log handler.

Type

\Horde_Log_Logger

Methods

__construct()

__construct(string  $user, array  $params = array()) 

Constructor.

Parameters

string $user

The username.

array $params

Configuration parameters.

'kolab'  - (Horde_Kolab_Storage) [REQUIRED] The storage backend.
'folder' - (string) The default name of the preferences folder.
           DEFAULT: _('Preferences')

Throws

\InvalidArgumentException

getParams()

getParams() : array

Get the list of driver parameters.

Returns

array —

Driver parameters.

get()

get(\Horde_Prefs_Scope  $scope_ob) : \Horde_Prefs_Scope

Retrieves the requested preferences scope from the storage backend.

Parameters

\Horde_Prefs_Scope $scope_ob

The scope object.

Throws

\Horde_Prefs_Exception

Returns

\Horde_Prefs_Scope

The modified scope object.

store()

store(\Horde_Prefs_Scope  $scope_ob) 

Stores changed preferences in the storage backend.

Parameters

\Horde_Prefs_Scope $scope_ob

The scope object.

Throws

\Horde_Prefs_Exception

onChange()

onChange(string  $scope, string  $pref) 

Called whenever a preference value is changed.

Parameters

string $scope

Scope specifier.

string $pref

The preference name.

remove()

remove(string  $scope = null, string  $pref = null) 

Removes preferences from the backend.

Parameters

string $scope

The scope of the prefs to clear. If null, clears all scopes.

string $pref

The pref to clear. If null, clears the entire scope.

Throws

\Horde_Prefs_Exception

listScopes()

listScopes() : array

Lists all available scopes.

Returns

array —

The list of scopes stored in the backend.

_getStorage()

_getStorage(boolean  $create_missing = false) : \Horde_Kolab_Storage_Data

Opens a connection to the Kolab server.

Parameters

boolean $create_missing

Create a preferences folder if it is missing.

Throws

\Horde_Prefs_Exception

Returns

\Horde_Kolab_Storage_Data —

The storage backend.

_prefToArray()

_prefToArray(array  $pref) : array

Convert Kolab preferences data to an array.

Parameters

array $pref

The preferences list.

Returns

array —

The preferences data as array.

_arrayToPref()

_arrayToPref(array  $pref) : array

Convert a key => value list of preferences to the Kolab preferences.

Parameters

array $pref

The preferences.

Returns

array —

The preferences data as list.

_logMissingStorage()

_logMissingStorage(\Exception  $e) : NULL

Log the missing backend.

Parameters

\Exception $e

The exception that occurred.

Returns

NULL

_logMissingScope()

_logMissingScope(\Exception  $e, string  $scope) : NULL

Log the missing scope.

Parameters

\Exception $e

The exception that occurred.

string $scope

The scope that was attempted to get.

Returns

NULL