DbStorage

Implements\LimeSurvey\PluginManager\iPluginStorage

package

Default

Methods

NB: Needed even if empty.

__construct()

The constructor must be part of the interface since our Plugin factory calls it and thus must know its arguments.

Returns plugin data.

get(\LimeSurvey\PluginManager\iPlugin $plugin,string $key = null,string $model = null,integer $id = null,mixed $default = null,string $language = null): mixed

Arguments

$plugin

\LimeSurvey\PluginManager\iPlugin

The plugin object getting its data.

$key

string

Key for the setting; passing null will return all keys.

$model

string

Optional model name to which the data was attached.

$id

integer

Optional id of the model instance to which the data was attached.

$default

mixed

Default value to return if key could not be found.

$language

string

Optional language identifier used for retrieving the setting.

Response

mixed

Returns the value from the database or null if not set.

getGeneric

getGeneric(\LimeSurvey\PluginManager\iPlugin $plugin,string $key,string $model,integer $id,mixed $default): mixed

Arguments

$key

string

$model

string

Optional model name to which the data was attached.

$id

integer

Optional id of the model instance to which the data was attached.

$default

mixed

Default value to return if key could not be found.

Response

mixed

Returns the value from the database or null if not set.

Stores plugin data.

set(\LimeSurvey\PluginManager\iPlugin $plugin,string $key,mixed $data,string $model = null,integer $id = null,string $language = null): boolean

Arguments

$plugin

\LimeSurvey\PluginManager\iPlugin

The plugin object getting its data.

$key

string

The storage key to identify the data.

$data

mixed

The data to be stored, serialized using serialize.

$model

string

Optional model name to which the data was attached.

$id

integer

Optional id of the model instance to which the data was attached.

$language

string

Optional language identifier used for storing the setting.

Response

boolean

setGeneric

setGeneric(\LimeSurvey\PluginManager\iPlugin $plugin,string $key, $data,string $model,integer $id,string $language): boolean

Arguments

$key

string

$data

$model

string

Optional model name to which the data was attached.

$id

integer

Optional id of the model instance to which the data was attached.

$language

string

Optional language identifier used for storing the setting.

Response

boolean