ILIAS
release_8 Revision v8.19
|
Class to represent a platform 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... | |
getPlatform () | |
Get tool consumer. More... | |
setPlatformId (int $platformId) | |
Set platform ID. More... | |
getKey () | |
Get consumer key. More... | |
getId () | |
Get context ID. More... | |
getRecordId () | |
Get the context record ID. More... | |
setRecordId (int $id) | |
Sets the context record ID. More... | |
getDataConnector () | |
Get the data connector. More... | |
getSetting (string $name, string $default='') | |
Get a setting value. More... | |
setSetting (string $name, string $value=null) | |
Set a setting value. More... | |
getSettings () | |
Get an array of all setting values. More... | |
setSettings (array $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 (int $mode=Service\ToolSettings::MODE_CURRENT_LEVEL, bool $simple=true) | |
Get Tool Settings. More... | |
setToolSettings (array $settings=array()) | |
Set Tool Settings. More... | |
hasGroupService () | |
Check if a Course Group service is available. More... | |
getGroups () | |
Get course group sets and groups. More... | |
hasMembershipService () | |
Check if the Membership service is supported. More... | |
hasMembershipsService () | |
Check if a Membership service is available. More... | |
getMembership () | |
Get Membership. More... | |
getMemberships (bool $withGroups=false) | |
Get Memberships. More... | |
hasLineItemService () | |
Check if the Line Item service is available. More... | |
hasScoreService () | |
Check if the Score service is available. More... | |
hasResultService () | |
Check if the Result service is available. More... | |
getLineItems (string $resourceId=null, string $tag=null, int $limit=null) | |
Get line items. More... | |
createLineItem (LineItem $lineItem) | |
Create a new line item. More... | |
Static Public Member Functions | |
static | fromRecordId (int $id, \ILIAS\LTI\ToolProvider\DataConnector\DataConnector $dataConnector) |
Load the context from the database. More... | |
static | fromPlatform (Platform $platform, string $ltiContextId) |
Class constructor from consumer. More... | |
Data Fields | |
string | $ltiContextId = null |
Context ID as supplied in the last connection request. More... | |
string | $title = null |
Context title. More... | |
string | $type = null |
Context type. More... | |
array | $groupSets = null |
User group sets (null if the platform does not support the groups enhancement) More... | |
array | $groups = null |
User groups (null if the platform does not support the groups enhancement) More... | |
HTTPMessage | $lastServiceRequest = null |
HttpMessage object for last service request. More... | |
int | $created = null |
Timestamp for when the object was created. More... | |
int | $updated = null |
Timestamp for when the object was last updated. More... | |
Private Member Functions | |
load (int $id=null) | |
Load the context from the database. More... | |
getLineItemService () | |
Get the Line Item service object. More... | |
Private Attributes | |
Platform | $platform = null |
Platform for this context. More... | |
int | $platformId = null |
Platform ID for this context. More... | |
int | $id = null |
ID for this context. More... | |
array | $settings = null |
Setting values (LTI parameters, custom parameters and local parameters). More... | |
bool | $settingsChanged = false |
Whether the settings value have changed since last saved. More... | |
ILIAS LTI ToolProvider DataConnector DataConnector | $dataConnector = null |
Data connector object or string. More... | |
Class to represent a platform context.
Definition at line 33 of file Context.php.
ILIAS\LTI\ToolProvider\Context::__construct | ( | ) |
Class constructor.
Definition at line 151 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\initialize().
ILIAS\LTI\ToolProvider\Context::createLineItem | ( | LineItem | $lineItem | ) |
Create a new line item.
LineItem | $lineItem | Line item object |
Definition at line 647 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\getLineItemService().
ILIAS\LTI\ToolProvider\Context::delete | ( | ) |
Delete the context from the database.
Definition at line 199 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\getDataConnector().
|
static |
Class constructor from consumer.
Definition at line 695 of file Context.php.
References $context, ILIAS\LTI\ToolProvider\Context\$ltiContextId, ILIAS\LTI\ToolProvider\Context\$platform, and ILIAS\LTI\ToolProvider\Platform\getDataConnector().
Referenced by ILIAS\LTI\ToolProvider\Tool\authenticate().
|
static |
Load the context from the database.
int | $id | Record ID of context |
\ILIAS\LTI\ToolProvider\DataConnector\DataConnector | $dataConnector | Database connection object |
Definition at line 664 of file Context.php.
References $context, and ILIAS\LTI\ToolProvider\Context\$dataConnector.
Referenced by ILIAS\LTI\ToolProvider\ResourceLink\getContext().
ILIAS\LTI\ToolProvider\Context::getDataConnector | ( | ) |
Get the data connector.
Definition at line 302 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$dataConnector.
Referenced by ILIAS\LTI\ToolProvider\Context\delete(), ILIAS\LTI\ToolProvider\ResourceLink\fromContext(), ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\load(), and ILIAS\LTI\ToolProvider\Context\save().
ILIAS\LTI\ToolProvider\Context::getGroups | ( | ) |
Get course group sets and groups.
Definition at line 459 of file Context.php.
References ILIAS\LTI\ToolProvider\ApiHook\$GROUPS_SERVICE_HOOK, $service, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Context::getId | ( | ) |
Get context ID.
Definition at line 273 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$ltiContextId.
ILIAS\LTI\ToolProvider\Context::getKey | ( | ) |
Get consumer key.
Definition at line 263 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\getPlatform().
ILIAS\LTI\ToolProvider\Context::getLineItems | ( | string | $resourceId = null , |
string | $tag = null , |
||
int | $limit = null |
||
) |
Get line items.
string | null | $resourceId | Tool resource ID |
string | null | $tag | Tag |
int | null | $limit | Limit of line items to be returned in each request, null for service default |
Definition at line 628 of file Context.php.
References $http, and ILIAS\LTI\ToolProvider\Context\getLineItemService().
|
private |
Get the Line Item service object.
Definition at line 729 of file Context.php.
References $url, ILIAS\LTI\ToolProvider\Context\getPlatform(), and ILIAS\LTI\ToolProvider\Context\getSetting().
Referenced by ILIAS\LTI\ToolProvider\Context\createLineItem(), and ILIAS\LTI\ToolProvider\Context\getLineItems().
ILIAS\LTI\ToolProvider\Context::getMembership | ( | ) |
Get Membership.
Definition at line 516 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\getMemberships(), and ILIAS\LTI\ToolProvider\Util\logDebug().
ILIAS\LTI\ToolProvider\Context::getMemberships | ( | bool | $withGroups = false | ) |
Get Memberships.
bool | $withGroups | True is group information is to be requested as well |
Definition at line 530 of file Context.php.
References $format, ILIAS\LTI\ToolProvider\ApiHook\$GROUPS_SERVICE_HOOK, ILIAS\LTI\ToolProvider\ApiHook\$MEMBERSHIPS_SERVICE_HOOK, $service, $url, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook(), ILIAS\LTI\ToolProvider\Service\Membership\MEDIA_TYPE_MEMBERSHIPS_NRPS, and ILIAS\LTI\ToolProvider\Service\Membership\MEDIA_TYPE_MEMBERSHIPS_V1.
Referenced by ILIAS\LTI\ToolProvider\Context\getMembership().
ILIAS\LTI\ToolProvider\Context::getPlatform | ( | ) |
Get tool consumer.
int | $consumerId | Tool Consumer ID for this context. Get platform. |
Definition at line 239 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$platform, ilLTIPlatform\fromRecordId(), and ILIAS\LTI\ToolProvider\Context\getDataConnector().
Referenced by ILIAS\LTI\ToolProvider\Service\Groups\__construct(), ILIAS\LTI\ToolProvider\Context\getGroups(), ILIAS\LTI\ToolProvider\Context\getKey(), ILIAS\LTI\ToolProvider\Context\getLineItemService(), ILIAS\LTI\ToolProvider\Context\getMemberships(), ILIAS\LTI\ToolProvider\Context\getToolSettings(), ILIAS\LTI\ToolProvider\Context\hasGroupService(), ILIAS\LTI\ToolProvider\Context\hasMembershipsService(), ILIAS\LTI\ToolProvider\Context\hasToolSettingsService(), ilLTIDataConnector\loadContext(), ilLTIDataConnector\saveContext(), and ILIAS\LTI\ToolProvider\Context\setToolSettings().
ILIAS\LTI\ToolProvider\Context::getRecordId | ( | ) |
Get the context record ID.
Definition at line 283 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$id.
Referenced by ilLTIDataConnector\deleteContext(), ilLTIDataConnector\loadContext(), ilLTIDataConnector\saveContext(), and ILIAS\LTI\ToolProvider\ResourceLink\setContext().
ILIAS\LTI\ToolProvider\Context::getSetting | ( | string | $name, |
string | $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 313 of file Context.php.
References $name, and ILIAS\Repository\settings().
Referenced by ILIAS\LTI\ToolProvider\Context\getGroups(), ILIAS\LTI\ToolProvider\Context\getLineItemService(), ILIAS\LTI\ToolProvider\Context\getMemberships(), ILIAS\LTI\ToolProvider\Context\getToolSettings(), ILIAS\LTI\ToolProvider\Context\hasGroupService(), ILIAS\LTI\ToolProvider\Context\hasLineItemService(), ILIAS\LTI\ToolProvider\Context\hasMembershipsService(), ILIAS\LTI\ToolProvider\Context\hasResultService(), ILIAS\LTI\ToolProvider\Context\hasScoreService(), ILIAS\LTI\ToolProvider\Context\hasToolSettingsService(), ILIAS\LTI\ToolProvider\Context\setSetting(), and ILIAS\LTI\ToolProvider\Context\setToolSettings().
ILIAS\LTI\ToolProvider\Context::getSettings | ( | ) |
Get an array of all setting values.
Definition at line 347 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$settings.
Referenced by ilLTIDataConnector\saveContext().
ILIAS\LTI\ToolProvider\Context::getToolSettings | ( | int | $mode = Service\ToolSettings::MODE_CURRENT_LEVEL , |
bool | $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 397 of file Context.php.
References $service, ILIAS\LTI\ToolProvider\Context\$settings, ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, $url, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Context::hasGroupService | ( | ) |
Check if a Course Group service is available.
Definition at line 445 of file Context.php.
References ILIAS\LTI\ToolProvider\ApiHook\$MEMBERSHIPS_SERVICE_HOOK, ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Context::hasLineItemService | ( | ) |
Check if the Line Item service is available.
Definition at line 572 of file Context.php.
References $scopes, and ILIAS\LTI\ToolProvider\Context\getSetting().
ILIAS\LTI\ToolProvider\Context::hasMembershipService | ( | ) |
Check if the Membership service is supported.
Definition at line 485 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\hasMembershipsService(), and ILIAS\LTI\ToolProvider\Util\logDebug().
ILIAS\LTI\ToolProvider\Context::hasMembershipsService | ( | ) |
Check if a Membership service is available.
Definition at line 499 of file Context.php.
References ILIAS\LTI\ToolProvider\ApiHook\$MEMBERSHIPS_SERVICE_HOOK, ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
Referenced by ILIAS\LTI\ToolProvider\Context\hasMembershipService().
ILIAS\LTI\ToolProvider\Context::hasResultService | ( | ) |
Check if the Result service is available.
Definition at line 608 of file Context.php.
References ILIAS\LTI\ToolProvider\Service\Result\$SCOPE, $scopes, and ILIAS\LTI\ToolProvider\Context\getSetting().
ILIAS\LTI\ToolProvider\Context::hasScoreService | ( | ) |
Check if the Score service is available.
Definition at line 590 of file Context.php.
References ILIAS\LTI\ToolProvider\Service\Score\$SCOPE, $scopes, and ILIAS\LTI\ToolProvider\Context\getSetting().
ILIAS\LTI\ToolProvider\Context::hasToolSettingsService | ( | ) |
Check if the Tool Settings service is available.
Definition at line 382 of file Context.php.
References ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Context::initialise | ( | ) |
Initialise the context.
Synonym for initialize().
Definition at line 174 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\initialize().
ILIAS\LTI\ToolProvider\Context::initialize | ( | ) |
Initialise the context.
Definition at line 159 of file Context.php.
References ILIAS\Repository\settings().
Referenced by ILIAS\LTI\ToolProvider\Context\__construct(), ILIAS\LTI\ToolProvider\DataConnector\DataConnector\deleteContext(), ilLTIDataConnector\deleteContext(), ILIAS\LTI\ToolProvider\Context\initialise(), and ILIAS\LTI\ToolProvider\Context\load().
|
private |
Load the context from the database.
int | null | $id | Record ID of context (optional, default is null) |
Definition at line 717 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$id, ILIAS\LTI\ToolProvider\Context\getDataConnector(), and ILIAS\LTI\ToolProvider\Context\initialize().
ILIAS\LTI\ToolProvider\Context::save | ( | ) |
Save the context to the database.
Definition at line 184 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\getDataConnector().
Referenced by ILIAS\LTI\ToolProvider\Context\saveSettings().
ILIAS\LTI\ToolProvider\Context::saveSettings | ( | ) |
Save setting values.
Definition at line 366 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\save().
ILIAS\LTI\ToolProvider\Context::setPlatformId | ( | int | $platformId | ) |
Set platform ID.
int | $platformId | Platform ID for this context. |
Definition at line 252 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$platformId.
Referenced by ilLTIDataConnector\loadContext().
ILIAS\LTI\ToolProvider\Context::setRecordId | ( | int | $id | ) |
Sets the context record ID.
int | $id | Context record ID value |
Definition at line 292 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$id.
Referenced by ilLTIDataConnector\loadContext(), and ilLTIDataConnector\saveContext().
ILIAS\LTI\ToolProvider\Context::setSetting | ( | string | $name, |
string | $value = null |
||
) |
Set a setting value.
string | $name | Name of setting |
string | null | $value | Value to set, use an empty value to delete a setting (optional, default is null) |
Definition at line 329 of file Context.php.
References $name, ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\Repository\settings().
ILIAS\LTI\ToolProvider\Context::setSettings | ( | array | $settings | ) |
Set an array of all setting values.
array | $settings | Associative array of setting values |
Definition at line 356 of file Context.php.
References ILIAS\LTI\ToolProvider\Context\$settings, and ILIAS\Repository\settings().
Referenced by ilLTIDataConnector\loadContext().
ILIAS\LTI\ToolProvider\Context::setToolSettings | ( | array | $settings = array() | ) |
Set Tool Settings.
array | $settings | An associative array of settings (optional, default is none) |
Definition at line 422 of file Context.php.
References $service, ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, $url, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Context\getPlatform(), ILIAS\LTI\ToolProvider\Context\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
int null ILIAS\LTI\ToolProvider\Context::$created = null |
Timestamp for when the object was created.
Definition at line 97 of file Context.php.
|
private |
Data connector object or string.
Definition at line 146 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\fromRecordId(), and ILIAS\LTI\ToolProvider\Context\getDataConnector().
array null ILIAS\LTI\ToolProvider\Context::$groups = null |
User groups (null if the platform does not support the groups enhancement)
A group is represented by an associative array with the following elements:
Definition at line 83 of file Context.php.
array null ILIAS\LTI\ToolProvider\Context::$groupSets = null |
User group sets (null if the platform does not support the groups enhancement)
A group set is represented by an associative array with the following elements:
Definition at line 71 of file Context.php.
|
private |
ID for this context.
Definition at line 125 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\getRecordId(), ILIAS\LTI\ToolProvider\Context\load(), and ILIAS\LTI\ToolProvider\Context\setRecordId().
HttpMessage null ILIAS\LTI\ToolProvider\Context::$lastServiceRequest = null |
HttpMessage object for last service request.
Definition at line 90 of file Context.php.
string null ILIAS\LTI\ToolProvider\Context::$ltiContextId = null |
Context ID as supplied in the last connection request.
Definition at line 42 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\fromPlatform(), and ILIAS\LTI\ToolProvider\Context\getId().
|
private |
Platform for this context.
Definition at line 111 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\fromPlatform(), and ILIAS\LTI\ToolProvider\Context\getPlatform().
|
private |
Platform ID for this context.
Definition at line 118 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\setPlatformId().
|
private |
Setting values (LTI parameters, custom parameters and local parameters).
Definition at line 132 of file Context.php.
Referenced by ILIAS\LTI\ToolProvider\Context\getSettings(), ILIAS\LTI\ToolProvider\Context\getToolSettings(), and ILIAS\LTI\ToolProvider\Context\setSettings().
|
private |
Whether the settings value have changed since last saved.
Definition at line 139 of file Context.php.
string null ILIAS\LTI\ToolProvider\Context::$title = null |
Context title.
Definition at line 49 of file Context.php.
string null ILIAS\LTI\ToolProvider\Context::$type = null |
Context type.
Definition at line 56 of file Context.php.
int null ILIAS\LTI\ToolProvider\Context::$updated = null |
Timestamp for when the object was last updated.
Definition at line 104 of file Context.php.