class Entity

This is a class holding commmon functionality to be extended by various other classes.

Traits

This is a trait convienence methods to access the session from the launch object
This is a class holding convienence methods to access the json column for the core objects.

Properties

$launch A reference to our containing launch

Methods

session_get($key, $default = null)

Get a key from the session

session_put($key, $value)

Set a key in the session

session_forget($key)

Forget a key in the session

session_flush()

Flush the session

ltiRawPostArray()

Return the original $_POST array

ltiParameter($varname, $default = false)

Pull a keyed variable from the original LTI post data in the current session with default

ltiParameterUpdate($varname, $value)

Update a keyed variable from the original LTI post data in the current session with default

ltiRawParameter($varname, $default = false)

Pull a keyed variable from the original LTI post data in the current session with default

ltiCustomGet($varname, $default = false)

Pull out a custom variable from the LTIX session. Do not include the "custom_" prefix - this is automatic.

string
getJson()

Load the json field for this entity

from JsonTrait
getJsonKeyLegacy($key, $default = false)

No description

from JsonTrait
getJsonKey($key, $default = false)

Get a JSON key for this entity

from JsonTrait
setJson($json)

Set the JSON entry for this entity

from JsonTrait
setJsonKey($key, $value)

Set/update a JSON key for this entity

from JsonTrait
setJsonKeys($values)

Set/update an array of JSON keys for this entity

from JsonTrait

Details

in SessionTrait at line 17
session_get($key, $default = null)

Get a key from the session

Parameters

$key
$default

in SessionTrait at line 24
session_put($key, $value)

Set a key in the session

Parameters

$key
$value

in SessionTrait at line 31
session_forget($key)

Forget a key in the session

Parameters

$key

in SessionTrait at line 38
session_flush()

Flush the session

in SessionTrait at line 45
ltiRawPostArray()

Return the original $_POST array

in SessionTrait at line 53
ltiParameter($varname, $default = false)

Pull a keyed variable from the original LTI post data in the current session with default

Parameters

$varname
$default

in SessionTrait at line 61
ltiParameterUpdate($varname, $value)

Update a keyed variable from the original LTI post data in the current session with default

Parameters

$varname
$value

in SessionTrait at line 70
ltiRawParameter($varname, $default = false)

Pull a keyed variable from the original LTI post data in the current session with default

Parameters

$varname
$default

in SessionTrait at line 79
ltiCustomGet($varname, $default = false)

Pull out a custom variable from the LTIX session. Do not include the "custom_" prefix - this is automatic.

Parameters

$varname
$default

in JsonTrait at line 21
string getJson()

Load the json field for this entity

Return Value

string This returns the json string - it is not parsed - if there is nothing to return - this returns "false"

in JsonTrait at line 43
getJsonKeyLegacy($key, $default = false)

Parameters

$key
$default

in JsonTrait at line 61
getJsonKey($key, $default = false)

Get a JSON key for this entity

Parameters

$key The key to be retrieved from the JSON
$default The default value (optional)

in JsonTrait at line 78
setJson($json)

Set the JSON entry for this entity

Parameters

$json This is a string - no validation is done

in JsonTrait at line 96
setJsonKey($key, $value)

Set/update a JSON key for this entity

Parameters

$key The key to be inserted/updated in the JSON
$value The value to be inserted/updated in the JSON

in JsonTrait at line 114
setJsonKeys($values)

Set/update an array of JSON keys for this entity

Parameters

$values An array of key/value pairs to be inserted/updated in the JSON