\Horde_Prefs_Storage_Sql

Preferences storage implementation for a SQL database.

Summary

Methods
Properties
Constants
__construct()
getParams()
get()
store()
onChange()
remove()
listScopes()
getCharset()
No public properties found
No constants found
No protected methods found
$_params
$_db
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : string

Configuration parameters.

'user' is always available as an entry.

Type

string

$_db

$_db : \Horde_Db_Adapter

Handle for the current database connection.

Type

\Horde_Db_Adapter

Methods

__construct()

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

Constructor.

Parameters

string $user

The username.

array $params

Configuration parameters:

  • db: (Horde_Db_Adapter) [REQUIRED] The DB instance.
  • table: (string) The name of the prefs table. DEFAULT: 'horde_prefs'

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.

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.

getCharset()

getCharset() : string

Returns the charset of the DB backend.

Returns

string —

The connection's charset.