class Settings

deprecated

This is a class to provide access to the setting service.

There are three scopes of settings: link, context, and key The link level settings are by far the most widely used.

In effect, this should be deprecated and folks should use the methods in each entity.

A better pattern:

$LAUNCH = LTIX::requireData(); $LAUNCH->link->settingsSet('key', 'value');

But this is widely used in tool code so it will be hard to remove. At least now it wraps the Link settings.

Methods

static 
getDebugArray()

Retrieve the debug array for the last operation.

static 
linkSetAll($keyvals)

Set all of the the link-level settings.

static 
linkGetAll()

Retrieve an array of all of the link level settings

static 
linkGet($key, $default = false)

Retrieve a particular key from the link settings.

static 
linkSet($key, $value)

Set or update a key to a new value in link settings.

static 
linkUpdate($keyvals)

Set or update a number of keys to new values in link settings.

Details

at line 31
static getDebugArray()

Retrieve the debug array for the last operation.

at line 46
static linkSetAll($keyvals)

Set all of the the link-level settings.

Parameters

$keyvals An array of key/value pairs that is serialized in JSON and stored. If this is an empty array, this effectively empties out all the settings.

at line 64
static linkGetAll()

Retrieve an array of all of the link level settings

If there are no settings, return an empty array.

This routine also looks for legacy custom fields and treats them as defaults for settings if the corresponding key is not already present in settings. This will slowly convert LTI 1.x custom parameters under the control of the LMS to LTI 2.x style settings under control of our local tools.

at line 80
static linkGet($key, $default = false)

Retrieve a particular key from the link settings.

Returns the value found in settings or false if the key was not found.

Parameters

$key
  • The key to get from the settings.
$default
  • What to return if the key is not present

at line 93
static linkSet($key, $value)

Set or update a key to a new value in link settings.

Parameters

$key
$value

at line 106
static linkUpdate($keyvals)

Set or update a number of keys to new values in link settings.

Parameters

$keyvals