Link
class Link extends Entity
This is a class to provide access to the resource link level data.
This data comes from the LTI launch from the LMS. A resource_link may or may not be in a context. If there is a link without a context, it is a "system-wide" link like "view profile" or "show all courses"
Traits
Properties
$launch | A reference to our containing launch | from Entity | |
$settingsDebugArray | from SettingsTrait | ||
protected | $TABLE_NAME | ||
protected | $PRIMARY_KEY | ||
protected | $ENTITY_NAME | ||
$id | The integer primary key for this link in the 'lti_link' table. | ||
$title | The link title | ||
$grade | The current grade for the user | ||
$result_id | The result_id for the link (if set) | ||
$activity | The count of the overall activity on this link at the moment of launch | ||
$user_activity | The count of the user's activity on this link at the moment of launch |
Methods
Pull a keyed variable from the original LTI post data in the current session with default
Update a keyed variable from the original LTI post data in the current session with default
Pull a keyed variable from the original LTI post data in the current session with default
Pull out a custom variable from the LTIX session. Do not include the "custom_" prefix - this is automatic.
Set or update a number of keys to new values in link settings.
Load link information for a different link than current
Get the placement secret for this Link
Load defaults from custom parameters once
Details
in SessionTrait at line 17
session_get($key, $default = null)
Get a key from the session
in SessionTrait at line 24
session_put($key, $value)
Set a key in the session
in SessionTrait at line 31
session_forget($key)
Forget a key in the session
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
in SessionTrait at line 61
ltiParameterUpdate($varname, $value)
Update a keyed variable from the original LTI post data in the current session with default
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
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.
in JsonTrait at line 21
string
getJson()
Load the json field for this entity
in JsonTrait at line 43
getJsonKeyLegacy($key, $default = false)
in JsonTrait at line 61
getJsonKey($key, $default = false)
Get a JSON key for this entity
in JsonTrait at line 78
setJson($json)
Set the JSON entry for this entity
in JsonTrait at line 96
setJsonKey($key, $value)
Set/update a JSON key for this entity
in JsonTrait at line 114
setJsonKeys($values)
Set/update an array of JSON keys for this entity
in SettingsTrait at line 23
settingsGetAll()
Retrieve an array of all of the settings
If there are no settings, return an empty array.
in SettingsTrait at line 70
settingsGet($key, $default = false)
Retrieve a particular key from the settings.
Returns the value found in settings or false if the key was not found.
in SettingsTrait at line 83
settingsSet($key, $value)
Update a single key in settings
in SettingsTrait at line 96
settingsUpdate($keyvals)
Set or update a number of keys to new values in link settings.
in SettingsTrait at line 119
protected
settingsSetAll($new_settings)
Replace all the settings (Dangerous)
in SettingsTrait at line 155
settingsDebug()
Retrieve the debug array for the last operation.
at line 73
static
loadLinkInfo($link_id)
Load link information for a different link than current
Make sure not to cross Context silos.
Returns a row or false.
at line 93
getPlacementSecret()
Get the placement secret for this Link
at line 127
settingsDefaultsFromCustom($keys)
Load defaults from custom parameters once
Example:
$LAUNCH->link->settingsDefaultsFromCustom(array('tries', 'delay'));