\Horde_Prefs_Storage_Mongo

Preferences storage implementation for a MongoDB database.

Summary

Methods
Properties
Constants
__construct()
getParams()
get()
store()
onChange()
remove()
listScopes()
checkMongoIndices()
createMongoIndices()
No public properties found
UID
SCOPE
NAME
VALUE
No protected methods found
$_params
$_db
$_indices
N/A
No private methods found
No private properties found
N/A

Constants

UID

UID

SCOPE

SCOPE

NAME

NAME

VALUE

VALUE

Properties

$_params

$_params : string

Configuration parameters.

'user' is always available as an entry.

Type

string

$_db

$_db : \MongoCollection

The MongoDB Collection object for the cache data.

Type

\MongoCollection

$_indices

$_indices : array

Indices list.

Type

array

Methods

__construct()

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

Constructor.

Parameters

string $user

The username.

array $params

Configuration parameters.

  - collection: (string) The collection name.
  - mongo_db: (Horde_Mongo_Client) [REQUIRED] A MongoDB client object.

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.

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.

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.

listScopes()

listScopes() : array

Lists all available scopes.

Returns

array —

The list of scopes stored in the backend.

checkMongoIndices()

checkMongoIndices() 

createMongoIndices()

createMongoIndices()