![]() |
LTI Integration Library
3.1.0
PHP class library for building LTI integrations
|
Class to represent a tool consumer context. More...
Public Member Functions | |
| __construct () | |
| Class constructor. More... | |
| initialize () | |
| Initialise the context. More... | |
| initialise () | |
| Initialise the context. More... | |
| save () | |
| Save the context to the database. More... | |
| delete () | |
| Delete the context from the database. More... | |
| getConsumer () | |
| Get tool consumer. More... | |
| setConsumerId ($consumerId) | |
| Set tool consumer ID. More... | |
| getKey () | |
| Get tool consumer key. More... | |
| getId () | |
| Get context ID. More... | |
| getRecordId () | |
| Get the context record ID. More... | |
| setRecordId ($id) | |
| Sets the context record ID. More... | |
| getDataConnector () | |
| Get the data connector. More... | |
| getSetting ($name, $default='') | |
| Get a setting value. More... | |
| setSetting ($name, $value=null) | |
| Set a setting value. More... | |
| getSettings () | |
| Get an array of all setting values. More... | |
| setSettings ($settings) | |
| Set an array of all setting values. More... | |
| saveSettings () | |
| Save setting values. More... | |
| hasToolSettingsService () | |
| Check if the Tool Settings service is available. More... | |
| getToolSettings ($mode=Service\ToolSettings::MODE_CURRENT_LEVEL, $simple=true) | |
| Get Tool Settings. More... | |
| setToolSettings ($settings=array()) | |
| Perform a Tool Settings service request. More... | |
| hasMembershipService () | |
| Check if the Membership service is supported. More... | |
| hasMembershipsService () | |
| Check if a Membership service is available. More... | |
| getMembership () | |
| Get Membership. More... | |
| getMemberships ($withGroups=false) | |
| Get Memberships. More... | |
Static Public Member Functions | |
| static | fromRecordId ($id, $dataConnector) |
| Load the context from the database. More... | |
| static | fromConsumer ($consumer, $ltiContextId) |
| Class constructor from consumer. More... | |
Static Public Member Functions inherited from ApiHook | |
| static | registerApiHook ($hookName, $familyCode, $className) |
| Register the availability of an API hook. More... | |
Data Fields | |
| $ltiContextId = null | |
| Context ID as supplied in the last connection request. More... | |
| $title = null | |
| Context title. More... | |
| $type = null | |
| Context type. More... | |
| $groupSets = null | |
| UserResult group sets (null if the consumer does not support the groups enhancement) More... | |
| $groups = null | |
| UserResult groups (null if the consumer does not support the groups enhancement) More... | |
| $lastServiceRequest = null | |
| HTTPMessage object for last service request. More... | |
| $created = null | |
| Timestamp for when the object was created. More... | |
| $updated = null | |
| Timestamp for when the object was last updated. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ApiHook | |
| static | $USER_ID_HOOK = "UserId" |
| User Id hook name. More... | |
| static | $CONTEXT_ID_HOOK = "ContextId" |
| Context Id hook name. More... | |
| static | $MEMBERSHIPS_SERVICE_HOOK = "Memberships" |
| Memberships service hook name. More... | |
| static | $OUTCOMES_SERVICE_HOOK = "Outcomes" |
| Outcomes service hook name. More... | |
| static | $TOOL_SETTINGS_SERVICE_HOOK = "ToolSettings" |
| Tool Settings service hook name. More... | |
Class to represent a tool consumer context.
Definition at line 17 of file Context.php.
| __construct | ( | ) |
| delete | ( | ) |
Delete the context from the database.
Definition at line 169 of file Context.php.
References Context\getDataConnector().
|
static |
Class constructor from consumer.
| ToolConsumer | $consumer | Consumer instance |
| string | $ltiContextId | LTI Context ID value |
Definition at line 484 of file Context.php.
References Context\$ltiContextId.
|
static |
Load the context from the database.
| int | $id | Record ID of context |
| DataConnector | $dataConnector | Database connection object |
Definition at line 467 of file Context.php.
Referenced by ResourceLink\getContext().
| getConsumer | ( | ) |
Get tool consumer.
Definition at line 179 of file Context.php.
References ToolConsumer\fromRecordId(), and Context\getDataConnector().
Referenced by Context\getKey(), Context\getMemberships(), Context\getToolSettings(), Context\hasMembershipsService(), Context\hasToolSettingsService(), and Context\setToolSettings().
| getDataConnector | ( | ) |
Get the data connector.
Definition at line 244 of file Context.php.
Referenced by Context\delete(), Context\getConsumer(), and Context\save().
| getId | ( | ) |
Get context ID.
Definition at line 214 of file Context.php.
References Context\$ltiContextId.
| getKey | ( | ) |
Get tool consumer key.
Definition at line 204 of file Context.php.
References Context\getConsumer().
| getMembership | ( | ) |
Get Membership.
Definition at line 425 of file Context.php.
References Context\getMemberships().
| getMemberships | ( | $withGroups = false | ) |
Get Memberships.
| bool | $withGroups | True is group information is to be requested as well |
Definition at line 437 of file Context.php.
References Context\getConsumer(), and Context\getSetting().
Referenced by Context\getMembership().
| getRecordId | ( | ) |
Get the context record ID.
Definition at line 224 of file Context.php.
| getSetting | ( | $name, | |
$default = '' |
|||
| ) |
Get a setting value.
| string | $name | Name of setting |
| string | $default | Value to return if the setting does not exist (optional, default is an empty string) |
Definition at line 257 of file Context.php.
Referenced by Context\getMemberships(), Context\getToolSettings(), Context\hasMembershipsService(), Context\hasToolSettingsService(), Context\setSetting(), and Context\setToolSettings().
| getSettings | ( | ) |
Get an array of all setting values.
Definition at line 292 of file Context.php.
| getToolSettings | ( | $mode = Service\ToolSettings::MODE_CURRENT_LEVEL, |
|
$simple = true |
|||
| ) |
Get Tool Settings.
| int | $mode | Mode for request (optional, default is current level only) |
| bool | $simple | True if all the simple media type is to be used (optional, default is true) |
Definition at line 345 of file Context.php.
References Context\getConsumer(), and Context\getSetting().
| hasMembershipService | ( | ) |
Check if the Membership service is supported.
Definition at line 398 of file Context.php.
References Context\hasMembershipsService().
| hasMembershipsService | ( | ) |
Check if a Membership service is available.
Definition at line 408 of file Context.php.
References Context\getConsumer(), and Context\getSetting().
Referenced by Context\hasMembershipService().
| hasToolSettingsService | ( | ) |
Check if the Tool Settings service is available.
Definition at line 328 of file Context.php.
References Context\getConsumer(), and Context\getSetting().
| initialise | ( | ) |
Initialise the context.
Pseudonym for initialize().
Definition at line 144 of file Context.php.
References Context\initialize().
| initialize | ( | ) |
Initialise the context.
Definition at line 129 of file Context.php.
Referenced by Context\__construct(), and Context\initialise().
| save | ( | ) |
Save the context to the database.
Definition at line 154 of file Context.php.
References Context\getDataConnector().
Referenced by Context\saveSettings().
| saveSettings | ( | ) |
Save setting values.
Definition at line 312 of file Context.php.
References Context\save().
| setConsumerId | ( | $consumerId | ) |
Set tool consumer ID.
| int | $consumerId | Tool Consumer ID for this resource link. |
Definition at line 193 of file Context.php.
| setRecordId | ( | $id | ) |
Sets the context record ID.
| int | $id | Context record ID value |
Definition at line 234 of file Context.php.
| setSetting | ( | $name, | |
$value = null |
|||
| ) |
Set a setting value.
| string | $name | Name of setting |
| string | $value | Value to set, use an empty value to delete a setting (optional, default is null) |
Definition at line 274 of file Context.php.
References Context\getSetting().
| setSettings | ( | $settings | ) |
Set an array of all setting values.
| array | $settings | Associative array of setting values |
Definition at line 302 of file Context.php.
| setToolSettings | ( | $settings = array() | ) |
Perform a Tool Settings service request.
| array | $settings | An associative array of settings (optional, default is none) |
Definition at line 372 of file Context.php.
References Context\getConsumer(), and Context\getSetting().
| int null $created = null |
Timestamp for when the object was created.
Definition at line 67 of file Context.php.
| array null $groups = null |
UserResult groups (null if the consumer does not support the groups enhancement)
Definition at line 53 of file Context.php.
| array null $groupSets = null |
UserResult group sets (null if the consumer does not support the groups enhancement)
Definition at line 46 of file Context.php.
| HTTPMessage null $lastServiceRequest = null |
HTTPMessage object for last service request.
Definition at line 60 of file Context.php.
| string null $ltiContextId = null |
Context ID as supplied in the last connection request.
Definition at line 25 of file Context.php.
Referenced by Context\fromConsumer(), and Context\getId().
| string null $title = null |
Context title.
Definition at line 32 of file Context.php.
| string null $type = null |
Context type.
Definition at line 39 of file Context.php.
| int null $updated = null |
Timestamp for when the object was last updated.
Definition at line 74 of file Context.php.