DbStorage

Implements \ls\pluginmanager\iPluginStorage

Methods

__construct

__construct() 

get

get(\ls\pluginmanager\iPlugin $plugin, string $key = null, string $model = null, int $id = null, mixed $default = null, string $language = null) : mixed

Arguments

$key

string

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

$model

string

Optional model name to which the data was attached.

$id

int

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(\ls\pluginmanager\iPlugin $plugin, string $key, string $model, int $id, mixed $default) : mixed

Arguments

$key

string

$model

string

Optional model name to which the data was attached.

$id

int

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.

This function retrieves plugin data related to the Question model.

getQuestion(\ls\pluginmanager\iPlugin $plugin, \ls\pluginmanager\type $key, \ls\pluginmanager\type $model, \ls\pluginmanager\type $id, \ls\pluginmanager\type $default, \ls\pluginmanager\type $language) 

LS saves this data in a question_attributes EAV table; therefore the 'Question' model is treated specially.

Arguments

$key

\ls\pluginmanager\type

$model

\ls\pluginmanager\type

$id

\ls\pluginmanager\type

$default

\ls\pluginmanager\type

$language

\ls\pluginmanager\type

Gets a field from the question table.

getQuestionBase(int $questionId, string $key, mixed $default) 

Arguments

$questionId

int

$key

string

$default

mixed

Default value in case key could not be found.

set

set(\ls\pluginmanager\iPlugin $plugin, string $key, $data, string $model = null, int $id = null, string $language = null) : boolean

Arguments

$key

string

$data

$model

string

Optional model name to which the data was attached.

$id

int

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(\ls\pluginmanager\iPlugin $plugin, string $key, $data, string $model, int $id, string $language) : boolean

Arguments

$key

string

$data

$model

string

Optional model name to which the data was attached.

$id

int

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

$language

string

Optional language identifier used for storing the setting.

Response

boolean

setQuestion

setQuestion(\ls\pluginmanager\iPlugin $plugin, string $key, $data, string $model, int $id, string $language) : boolean

Arguments

$key

string

$data

$model

string

Optional model name to which the data was attached.

$id

int

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

$language

string

Optional language identifier used for storing the setting.

Response

boolean

Sets a field from the question table.

setQuestionBase(int $questionId, string $key, mixed $data) 

Arguments

$questionId

int

$key

string

$data

mixed

Data to be saved.