100 $this->created = null;
101 $this->updated = null;
127 $this->settingsChanged =
false;
139 public function delete()
154 if (is_null($this->consumer)) {
169 $this->consumer = null;
265 if ($value !== $old_value) {
266 if (!empty($value)) {
271 $this->settingsChanged =
true;
308 if ($this->settingsChanged) {
load($id=null)
Load the context from the database.
getToolSettings($mode=Service\ToolSettings::MODE_CURRENT_LEVEL, $simple=true)
Get Tool Settings.
$settingsChanged
Whether the settings value have changed since last saved.
$consumerId
Tool Consumer ID for this context.
setSetting($name, $value=null)
Set a setting value.
hasMembershipService()
Check if the Membership service is supported.
getKey()
Get tool consumer key.
static fromRecordId($id, $dataConnector)
Load the context from the database.
initialise()
Initialise the context.
save()
Save the context to the database.
getDataConnector()
Get the data connector.
$dataConnector
Data connector object or string.
$created
Date/time when the object was created.
getSettings()
Get an array of all setting values.
initialize()
Initialise the context.
getRecordId()
Get the context record ID.
setSettings($settings)
Set an array of all setting values.
saveSettings()
Save setting values.
setConsumerId($consumerId)
Set tool consumer ID.
getMembership()
Get Memberships.
$consumer
Tool Consumer for this context.
__construct()
Class constructor.
setToolSettings($settings=array())
Perform a Tool Settings service request.
$updated
Date/time when the object was last updated.
$ltiContextId
Context ID as supplied in the last connection request.
Class to represent a tool consumer context.
getConsumer()
Get tool consumer.
static fromConsumer($consumer, $ltiContextId)
Class constructor from consumer.
getSetting($name, $default='')
Get a setting value.
$settings
Setting values (LTI parameters, custom parameters and local parameters).
setRecordId($id)
Sets the context record ID.
hasToolSettingsService()
Check if the Tool Settings service is supported.