Class to represent a platform resource link. More...
Public Member Functions | |
| __construct () | |
| Class constructor. | |
| void | initialize () |
| Initialise the resource link. | |
| void | initialise () |
| Initialise the resource link. | |
| bool | save () |
| Save the resource link to the database. | |
| bool | delete () |
| Delete the resource link from the database. | |
| Platform | getPlatform () |
| Get platform. | |
| int null | getPlatformId () |
| Get platform ID. | |
| void | setPlatformId (?int $platformId) |
| Set platform ID. | |
| Context null | getContext () |
| Get context. | |
| int null | getContextId () |
| Get context record ID. | |
| void | setContext (Context $context) |
| Set context. | |
| void | setContextId (?int $contextId) |
| Set context ID. | |
| string | getKey () |
| Get consumer key. | |
| string null | getId () |
| Get resource link ID. | |
| int null | getRecordId () |
| Get resource link record ID. | |
| setRecordId (int|string $id) | |
| Set resource link record ID. | |
| DataConnector null | getDataConnector () |
| Get the data connector. | |
| string | getSetting (string $name, string $default="") |
| Get a setting value. | |
| void | setSetting (string $name, string|array|null $value=null) |
| Set a setting value. | |
| array | getSettings () |
| Get an array of all setting values. | |
| void | setSettings (array $settings) |
| Set an array of all setting values. | |
| bool | saveSettings () |
| Save setting values. | |
| bool | hasOutcomesService () |
| Check if an Outcomes service is available. | |
| bool | hasMembershipsService () |
| Check if a Memberships service is available. | |
| bool | hasSettingService () |
| Check if the Setting extension service is available. | |
| 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. | |
| bool | hasAssessmentControlService () |
| Check if the Assessment Control service is available. | |
| bool | hasLinkContentService () |
| Check if the Link and Content service is available. | |
| bool | doOutcomesService (ServiceAction $action, Outcome $ltiOutcome, UserResult $userResult) |
| Perform an Outcomes service request. | |
| string bool | doSettingService (ServiceAction $action, ?string $value=null) |
| Perform a Setting service request. | |
| bool | hasToolSettingsService () |
| Check if the Tool Settings service is available. | |
| array bool | getToolSettings (?ToolSettingsMode $mode=null, bool $simple=true) |
| Get Tool Settings. | |
| bool | setToolSettings (array $settings=[]) |
| Set Tool Settings. | |
| array bool | getMemberships (bool $withGroups=false) |
| Get Memberships. | |
| UserResult[] | getUserResultSourcedIDs (bool $localOnly=false, ?IdScope $idScope=null) |
| Obtain an array of UserResult objects for users with a result sourcedId. | |
| ResourceLinkShare[] | getShares () |
| Get an array of ResourceLinkShare objects for each resource link which is sharing this context. | |
| LineItem[] bool | getLineItems (?string $resourceId=null, ?string $tag=null, ?int $limit=null) |
| Get line-items. | |
| bool | createLineItem (LineItem $lineItem) |
| Create a new line-item. | |
| ContentItem bool | getContentItem () |
| Get content-item. | |
| bool | deleteContentItem () |
| Delete content-item. | |
| Outcome[] bool | getOutcomes (?int $limit=null) |
| Get all outcomes. | |
| string bool | doAssessmentControlAction (AssessmentControlAction $assessmentControlAction, User $user, int $attemptNumber) |
| Perform an Assessment Control action. | |
Static Public Member Functions | |
| static ResourceLink | fromPlatform (Platform $platform, string $ltiResourceLinkId, ?string $tempId=null) |
| Class constructor from platform. | |
| static ResourceLink | fromContext (Context $context, string $ltiResourceLinkId, ?string $tempId=null) |
| Class constructor from context. | |
| static ResourceLink | fromRecordId (int $id, DataConnector $dataConnector) |
| Load the resource link from the database. | |
Public Attributes | |
| string | $title = null |
| Context title. | |
| string | $ltiResourceLinkId = null |
| Resource link ID as supplied in the last connection request. | |
| array | $groupSets = null |
| User group sets (null if the platform does not support the groups enhancement). | |
| array | $groups = null |
| User groups (null if the platform does not support the groups enhancement). | |
| HttpMessage | $lastServiceRequest = null |
| HttpMessage object for last service request. | |
| string null | $extRequest = null |
| Request for last service request. | |
| array | $extRequestHeaders = null |
| Request headers for last service request. | |
| string | $extResponse = null |
| Response from last service request. | |
| array | $extResponseHeaders = null |
| Response header from last service request. | |
| int | $primaryResourceLinkId = null |
| Primary key value for resource link being shared (if any). | |
| bool | $shareApproved = null |
| Whether the sharing request has been approved by the primary resource link. | |
| int | $created = null |
| Timestamp for when the object was created. | |
| int | $updated = null |
| Timestamp for when the object was last updated. | |
Class to represent a platform resource link.
| bool createLineItem | ( | LineItem | $lineItem | ) |
Create a new line-item.
| LineItem | $lineItem | Line-item object |
Referenced by getUserResultSourcedIDs().
| bool delete | ( | ) |
Delete the resource link from the database.
References Context\fromRecordId(), and getDataConnector().
| bool deleteContentItem | ( | ) |
Delete content-item.
References doAssessmentControlAction(), and getSetting().
| string bool doAssessmentControlAction | ( | AssessmentControlAction | $assessmentControlAction, |
| User | $user, | ||
| int | $attemptNumber ) |
Perform an Assessment Control action.
| AssessmentControlAction | $assessmentControlAction | Assessment control object |
| User | $user | User object |
| int | $attemptNumber | Number of attempt |
Referenced by deleteContentItem().
| bool doOutcomesService | ( | ServiceAction | $action, |
| Outcome | $ltiOutcome, | ||
| UserResult | $userResult ) |
Perform an Outcomes service request.
| ServiceAction | $action | The action type constant |
| Outcome | $ltiOutcome | Outcome object |
| UserResult | $userResult | UserResult object |
| string bool doSettingService | ( | ServiceAction | $action, |
| ?string | $value = null ) |
Perform a Setting service request.
| ServiceAction | $action | The action type |
| string | null | $value | The setting value (optional, default is null) |
References getPlatform(), getSetting(), and hasToolSettingsService().
|
static |
Class constructor from context.
| Context | $context | Context object |
| string | $ltiResourceLinkId | Resource link ID value |
| string | null | $tempId | Temporary Resource link ID value (optional, default is null) |
References getDataConnector(), and initialize().
|
static |
Class constructor from platform.
| Platform | $platform | Platform object |
| string | $ltiResourceLinkId | Resource link ID value |
| string | null | $tempId | Temporary Resource link ID value (optional, default is null) |
References fromRecordId().
|
static |
Load the resource link from the database.
| int | $id | Record ID of resource link |
| DataConnector | $dataConnector | Database connection object |
Referenced by UserResult\__construct(), and fromPlatform().
| ContentItem bool getContentItem | ( | ) |
Get content-item.
References getPlatform(), and getSetting().
Referenced by getLineItems().
| Context null getContext | ( | ) |
Get context.
Referenced by getToolSettings(), and setSettings().
| int null getContextId | ( | ) |
Get context record ID.
Referenced by getToolSettings(), and setSettings().
| DataConnector null getDataConnector | ( | ) |
Get the data connector.
Referenced by delete(), fromContext(), and initialize().
| string null getId | ( | ) |
Get resource link ID.
| string getKey | ( | ) |
Get consumer key.
| LineItem[] bool 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 |
References getContentItem().
| array bool getMemberships | ( | bool | $withGroups = false | ) |
Get Memberships.
| bool | $withGroups | True if group information is to be requested as well |
References getSetting().
Referenced by getToolSettings().
| Outcome[] bool getOutcomes | ( | ?int | $limit = null | ) |
Get all outcomes.
| int | null | $limit | Limit of outcomes to be returned in each request, null for service default |
| Platform getPlatform | ( | ) |
Get platform.
Referenced by doSettingService(), getContentItem(), getSettings(), getToolSettings(), and hasToolSettingsService().
| int null getPlatformId | ( | ) |
Get platform ID.
| int null getRecordId | ( | ) |
Get resource link record ID.
Referenced by DataConnector_mysqli\getUserResultSourcedIDsResourceLink(), DataConnector_oci8\getUserResultSourcedIDsResourceLink(), DataConnector_pdo\getUserResultSourcedIDsResourceLink(), DataConnector_pgsql\getUserResultSourcedIDsResourceLink(), DataConnector_sql\getUserResultSourcedIDsResourceLink(), DataConnector_mysqli\loadUserResult(), DataConnector_oci8\loadUserResult(), DataConnector_pdo\loadUserResult(), DataConnector_pgsql\loadUserResult(), DataConnector_sql\loadUserResult(), DataConnector_mysqli\saveResourceLinkShareKey(), and DataConnector_pdo\saveResourceLinkShareKey().
| string 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) |
Referenced by deleteContentItem(), doSettingService(), getContentItem(), getMemberships(), getToolSettings(), hasScoreService(), hasSettingService(), hasToolSettingsService(), setRecordId(), and setSettings().
| array getSettings | ( | ) |
Get an array of all setting values.
References getPlatform().
| ResourceLinkShare[] getShares | ( | ) |
Get an array of ResourceLinkShare objects for each resource link which is sharing this context.
| array bool getToolSettings | ( | ?ToolSettingsMode | $mode = null, |
| bool | $simple = true ) |
Get Tool Settings.
| ToolSettingsMode | null | $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) |
References getContext(), getContextId(), getMemberships(), getPlatform(), getSetting(), Membership\MEDIA_TYPE_MEMBERSHIPS_NRPS, and Membership\MEDIA_TYPE_MEMBERSHIPS_V1.
| UserResult[] getUserResultSourcedIDs | ( | bool | $localOnly = false, |
| ?IdScope | $idScope = null ) |
Obtain an array of UserResult objects for users with a result sourcedId.
The array may include users from other resource links which are sharing this resource link. It may also be optionally indexed by the user ID of a specified scope.
| bool | $localOnly | True if only users from this resource link are to be returned, not users from shared resource links (optional, default is false) |
| IdScope | null | $idScope | Scope to use for ID values (optional, default is null for platform default) |
References createLineItem().
| bool hasAssessmentControlService | ( | ) |
Check if the Assessment Control service is available.
| bool hasLineItemService | ( | ) |
Check if the Line-item service is available.
| bool hasLinkContentService | ( | ) |
Check if the Link and Content service is available.
| bool hasMembershipsService | ( | ) |
Check if a Memberships service is available.
| bool hasOutcomesService | ( | ) |
Check if an Outcomes service is available.
| bool hasResultService | ( | ) |
Check if the Result service is available.
References UserResult\getResourceLink().
| bool hasScoreService | ( | ) |
Check if the Score service is available.
References getSetting().
| bool hasSettingService | ( | ) |
Check if the Setting extension service is available.
References Result\$SCOPE, and getSetting().
| bool hasToolSettingsService | ( | ) |
Check if the Tool Settings service is available.
References getPlatform(), and getSetting().
Referenced by doSettingService().
| void initialise | ( | ) |
Initialise the resource link.
Synonym for initialize().
| bool save | ( | ) |
Save the resource link to the database.
| bool saveSettings | ( | ) |
Save setting values.
| void setContext | ( | Context | $context | ) |
Set context.
| Context | $context | Context for this resource link. |
| void setContextId | ( | ?int | $contextId | ) |
Set context ID.
| int | null | $contextId | Context ID for this resource link. |
| void setPlatformId | ( | ?int | $platformId | ) |
Set platform ID.
| int | null | $platformId | Platform ID for this resource link. |
| setRecordId | ( | int|string | $id | ) |
Set resource link record ID.
| int | string | $id | Record ID for this resource link. |
References getSetting().
| void setSetting | ( | string | $name, |
| string|array|null | $value = null ) |
Set a setting value.
| string | $name | Name of setting |
| string | array | null | $value | Value to set, use an empty value to delete a setting (optional, default is null) |
| void setSettings | ( | array | $settings | ) |
Set an array of all setting values.
| array | $settings | Associative array of setting values |
References getContext(), getContextId(), and getSetting().
| bool setToolSettings | ( | array | $settings = [] | ) |
Set Tool Settings.
| array | $settings | An associative array of settings (optional, default is none) |
| string null $extRequest = null |
Request for last service request.
$extRequest
| array $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:
| array $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: