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 supported. 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... | |
| getMembership () | |
| 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... | |
Data Fields | |
| $ltiContextId = null | |
| Context ID as supplied in the last connection request. More... | |
| $title = null | |
| Context title. More... | |
| $settings = null | |
| Setting values (LTI parameters, custom parameters and local parameters). More... | |
| $created = null | |
| Date/time when the object was created. More... | |
| $updated = null | |
| Date/time when the object was last updated. 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 139 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 425 of file Context.php.
References Context\$ltiContextId, Context\getDataConnector(), and Context\initialize().
Referenced by ToolProvider\onError().
|
static |
Load the context from the database.
| int | $id | Record ID of context |
| DataConnector | $dataConnector | Database connection object |
Definition at line 407 of file Context.php.
Referenced by ResourceLink\getContext().
| getConsumer | ( | ) |
Get tool consumer.
Definition at line 151 of file Context.php.
References ToolConsumer\fromRecordId(), and Context\getDataConnector().
Referenced by Context\getKey().
| getDataConnector | ( | ) |
Get the data connector.
Definition at line 227 of file Context.php.
Referenced by Context\delete(), Context\fromConsumer(), Context\getConsumer(), and Context\save().
| getId | ( | ) |
Get context ID.
Definition at line 191 of file Context.php.
References Context\$ltiContextId.
| getKey | ( | ) |
Get tool consumer key.
Definition at line 179 of file Context.php.
References Context\getConsumer().
| getMembership | ( | ) |
Get Memberships.
Definition at line 388 of file Context.php.
References Context\getSetting().
| getRecordId | ( | ) |
Get the context record ID.
Definition at line 203 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 242 of file Context.php.
Referenced by Context\getMembership(), Context\getToolSettings(), Context\hasMembershipService(), Context\hasToolSettingsService(), Context\setSetting(), and Context\setToolSettings().
| getSettings | ( | ) |
Get an array of all setting values.
Definition at line 281 of file Context.php.
References Context\$settings.
| getToolSettings | ( | $mode = Service\ToolSettings::MODE_CURRENT_LEVEL, |
|
$simple = true |
|||
| ) |
Get Tool Settings.
| int | $mode | Mode for request (optional, default is current level only) |
| boolean | $simple | True if all the simple media type is to be used (optional, default is true) |
Definition at line 340 of file Context.php.
References Context\getSetting().
| hasMembershipService | ( | ) |
Check if the Membership service is supported.
Definition at line 374 of file Context.php.
References Context\getSetting().
| hasToolSettingsService | ( | ) |
Check if the Tool Settings service is supported.
Definition at line 323 of file Context.php.
References Context\getSetting().
| initialise | ( | ) |
Initialise the context.
Pseudonym for initialize().
Definition at line 110 of file Context.php.
References Context\initialize().
| initialize | ( | ) |
Initialise the context.
Definition at line 95 of file Context.php.
Referenced by Context\__construct(), Context\fromConsumer(), and Context\initialise().
| save | ( | ) |
Save the context to the database.
Definition at line 122 of file Context.php.
References Context\getDataConnector().
Referenced by Context\saveSettings().
| saveSettings | ( | ) |
Save setting values.
Definition at line 305 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 166 of file Context.php.
| setRecordId | ( | $id | ) |
Sets the context record ID.
Definition at line 215 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 261 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 293 of file Context.php.
References Context\$settings.
| setToolSettings | ( | $settings = array() | ) |
Perform a Tool Settings service request.
| array | $settings | An associative array of settings (optional, default is none) |
Definition at line 358 of file Context.php.
References Context\$settings, and Context\getSetting().
| int $created = null |
Date/time when the object was created.
Definition at line 43 of file Context.php.
| string $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().
| array $settings = null |
Setting values (LTI parameters, custom parameters and local parameters).
Definition at line 37 of file Context.php.
Referenced by Context\getSettings(), Context\setSettings(), and Context\setToolSettings().
| string $title = null |
Context title.
Definition at line 31 of file Context.php.
| int $updated = null |
Date/time when the object was last updated.
Definition at line 49 of file Context.php.