Class to represent a platform context. More...
Public Member Functions | |
| __construct () | |
| Class constructor. | |
| initialize () | |
| Initialise the context. | |
| initialise () | |
| Initialise the context. | |
| bool | save () |
| Save the context to the database. | |
| bool | delete () |
| Delete the context from the database. | |
| ToolConsumer | getConsumer () |
| Get tool consumer. | |
| setConsumerId ($consumerId) | |
| Set tool consumer ID. | |
| Platform | getPlatform () |
| Get platform. | |
| setPlatformId ($platformId) | |
| Set platform ID. | |
| string | getKey () |
| Get consumer key. | |
| string | getId () |
| Get context ID. | |
| int null | getRecordId () |
| Get the context record ID. | |
| setRecordId ($id) | |
| Sets the context record ID. | |
| mixed | getDataConnector () |
| Get the data connector. | |
| string | getSetting ($name, $default='') |
| Get a setting value. | |
| setSetting ($name, $value=null) | |
| Set a setting value. | |
| array | getSettings () |
| Get an array of all setting values. | |
| setSettings ($settings) | |
| Set an array of all setting values. | |
| bool | saveSettings () |
| Save setting values. | |
| bool | hasToolSettingsService () |
| Check if the Tool Settings service is available. | |
| mixed | getToolSettings ($mode=Service\ToolSettings::MODE_CURRENT_LEVEL, $simple=true) |
| Get Tool Settings. | |
| bool | setToolSettings ($settings=array()) |
| Set Tool Settings. | |
| bool | hasGroupService () |
| Check if a Course Group service is available. | |
| bool | getGroups () |
| Get course group sets and groups. | |
| bool | hasMembershipService () |
| Check if the Membership service is supported. | |
| bool | hasMembershipsService () |
| Check if a Membership service is available. | |
| mixed | getMembership () |
| Get Membership. | |
| mixed | getMemberships ($withGroups=false) |
| Get Memberships. | |
| bool | hasLineItemService () |
| Check if the Line Item service is available. | |
| bool | hasScoreService () |
| Check if the Score service is available. | |
| bool | hasResultService () |
| Check if the Result service is available. | |
| LineItem[] bool | getLineItems ($resourceId=null, $tag=null, $limit=null) |
| Get line items. | |
| bool | createLineItem ($lineItem) |
| Create a new line item. | |
Static Public Member Functions | |
| static Context | fromRecordId ($id, $dataConnector) |
| Load the context from the database. | |
| static Context | fromConsumer ($consumer, $ltiContextId) |
| Class constructor from consumer. | |
| static Context | fromPlatform ($platform, $ltiContextId) |
| Class constructor from platform. | |
Static Public Member Functions inherited from ApiHook | |
| static void | registerApiHook ($hookName, $familyCode, $className) |
| Register the availability of an API hook. | |
Public Attributes | |
| string null | $ltiContextId = null |
| Context ID as supplied in the last connection request. | |
| string null | $title = null |
| Context title. | |
| string null | $type = null |
| Context type. | |
| array null | $groupSets = null |
| User group sets (null if the platform does not support the groups enhancement) | |
| array null | $groups = null |
| User groups (null if the platform does not support the groups enhancement) | |
| HttpMessage null | $lastServiceRequest = null |
| HttpMessage object for last service request. | |
| int null | $created = null |
| Timestamp for when the object was created. | |
| int null | $updated = null |
| Timestamp for when the object was last updated. | |
Additional Inherited Members | |
Static Public Attributes inherited from ApiHook | |
| static | $USER_ID_HOOK = "UserId" |
| User Id hook name. | |
| static | $CONTEXT_ID_HOOK = "ContextId" |
| Context Id hook name. | |
| static | $GROUPS_SERVICE_HOOK = "Groups" |
| Course Groups service hook name. | |
| static | $MEMBERSHIPS_SERVICE_HOOK = "Memberships" |
| Memberships service hook name. | |
| static | $OUTCOMES_SERVICE_HOOK = "Outcomes" |
| Outcomes service hook name. | |
| static | $TOOL_SETTINGS_SERVICE_HOOK = "ToolSettings" |
| Tool Settings service hook name. | |
| static | $ACCESS_TOKEN_SERVICE_HOOK = "AccessToken" |
| Access Token service hook name. | |
Class to represent a platform context.
| bool createLineItem | ( | $lineItem | ) |
Create a new line item.
| LineItem | $lineItem | Line item object |
| bool delete | ( | ) |
Delete the context from the database.
References Context\getDataConnector().
|
static |
Class constructor from consumer.
| ToolConsumer | $consumer | Consumer instance |
| string | $ltiContextId | LTI Context ID value |
|
static |
Class constructor from platform.
| Platform | $platform | Platform instance |
| string | $ltiContextId | LTI Context ID value |
|
static |
Load the context from the database.
| int | $id | Record ID of context |
| DataConnector | $dataConnector | Database connection object |
| ToolConsumer getConsumer | ( | ) |
Get tool consumer.
| mixed getDataConnector | ( | ) |
Get the data connector.
Referenced by Platform\__construct(), Context\delete(), and Tool\initialize().
| bool getGroups | ( | ) |
Get course group sets and groups.
| string getId | ( | ) |
Get context ID.
| string getKey | ( | ) |
Get consumer key.
| LineItem[] bool getLineItems | ( | $resourceId = null, |
|
$tag = null, |
|||
$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 |
| mixed getMembership | ( | ) |
Get Membership.
| mixed getMemberships | ( | $withGroups = false | ) |
Get Memberships.
| bool | $withGroups | True is group information is to be requested as well |
| Platform getPlatform | ( | ) |
Get platform.
Referenced by Context\setConsumerId().
| int null getRecordId | ( | ) |
Get the context record ID.
Referenced by ResourceLink\getKey().
| string 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) |
Referenced by Context\hasResultService(), and Context\hasScoreService().
| array getSettings | ( | ) |
Get an array of all setting values.
| mixed 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) |
| bool hasGroupService | ( | ) |
Check if a Course Group service is available.
| bool hasLineItemService | ( | ) |
Check if the Line Item service is available.
| bool hasMembershipService | ( | ) |
Check if the Membership service is supported.
| bool hasMembershipsService | ( | ) |
Check if a Membership service is available.
| bool hasResultService | ( | ) |
Check if the Result service is available.
References Score\$SCOPE, and Context\getSetting().
| bool hasScoreService | ( | ) |
Check if the Score service is available.
References Context\getSetting().
| bool hasToolSettingsService | ( | ) |
Check if the Tool Settings service is available.
References Context\save().
| initialise | ( | ) |
Initialise the context.
Synonym for initialize().
| bool save | ( | ) |
Save the context to the database.
Referenced by Context\hasToolSettingsService().
| bool saveSettings | ( | ) |
Save setting values.
| setConsumerId | ( | $consumerId | ) |
Set tool consumer ID.
| int | $consumerId | Tool Consumer ID for this context. |
References Context\getPlatform(), and Util\logDebug().
| setPlatformId | ( | $platformId | ) |
Set platform ID.
| int | $platformId | Platform ID for this context. |
| setRecordId | ( | $id | ) |
Sets the context record ID.
| int | $id | Context record ID value |
| 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) |
| setSettings | ( | $settings | ) |
Set an array of all setting values.
| array | $settings | Associative array of setting values |
| bool setToolSettings | ( | $settings = array() | ) |
Set Tool Settings.
| array | $settings | An associative array of settings (optional, default is none) |
| int null $created = null |
Timestamp for when the object was created.
$created
| array null $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:
$groups
| array null $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:
$groupSets
| HttpMessage null $lastServiceRequest = null |
HttpMessage object for last service request.
$lastServiceRequest
| string null $ltiContextId = null |
Context ID as supplied in the last connection request.
$ltiContextId
| string null $title = null |
Context title.
$title
| string null $type = null |
Context type.
$type
| int null $updated = null |
Timestamp for when the object was last updated.
$updated