Class to implement the Link and Content service. More...
Public Member Functions | |
| __construct (Platform $platform, string $endpoint, ?int $limit=null, bool $pagingMode=false) | |
| Class constructor. | |
| ContentItem[] bool | getAll (?string $ltiResourceLinkId=null, ?int $limit=null) |
| Retrieve all content items. | |
| bool | createContentItem (ContentItem &$contentItem) |
| Create a new content item. | |
| bool | saveContentItem (ContentItem &$contentItem) |
| Save a content item. | |
| bool | deleteContentItem () |
| Delete a content item. | |
| ContentItem bool | get () |
| Retrieve a content item. | |
| Public Member Functions inherited from Service | |
| __construct (Platform $platform, ?string $endpoint) | |
| Class constructor. | |
| Platform | getPlatform () |
| Get platform. | |
| string | getScope () |
| Get access scope. | |
| HttpMessage | send (string $method, ?array $parameters=[], string $body='') |
| Send a service request. | |
| HttpMessage | getHttpMessage () |
| Get HttpMessage object for last request. | |
Public Attributes | |
| const | MEDIA_TYPE_CONTENT_ITEM = 'application/json' |
| Content item media type. | |
| const | MEDIA_TYPE_CONTENT_ITEMS = 'application/json' |
| Content item container media type. | |
| Public Attributes inherited from Service | |
| bool | $unsigned = false |
| Whether service request should be sent unsigned. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Service | |
| array | parseContextsInArray (object|array $contexts, array $arr) |
| Parse the JSON for context references. | |
| Protected Attributes inherited from Service | |
| string | $endpoint = null |
| Service endpoint. | |
| string | $scope = null |
| Service access scope. | |
| string | $mediaType = null |
| Media type of message body. | |
Class to implement the Link and Content service.
This service can be used as either the context-level or item-level service.
| __construct | ( | Platform | $platform, |
| string | $endpoint, | ||
| ?int | $limit = null, | ||
| bool | $pagingMode = false ) |
Class constructor.
| Platform | $platform | Platform object for this service request |
| string | $endpoint | Service endpoint |
| int | null | $limit | Limit of content items to be returned in each request, null for all |
| bool | $pagingMode | True if only a single page should be requested when a limit is set |
References Util\setMessage().
| bool createContentItem | ( | ContentItem & | $contentItem | ) |
Create a new content item.
| ContentItem | $contentItem | Content item object |
References Service\send().
| bool deleteContentItem | ( | ) |
Delete a content item.
| ContentItem bool get | ( | ) |
Retrieve a content item.
| ContentItem[] bool getAll | ( | ?string | $ltiResourceLinkId = null, |
| ?int | $limit = null ) |
Retrieve all content items.
The returned items can be filtered by a resource link ID. Requests can also be limited to a number of items which may mean that multiple requests will be made to retrieve the full list.
| string | null | $ltiResourceLinkId | LTI resource link ID (optional) |
| int | null | $limit | Limit of content items to be returned in each request, null for service default (optional) |
References Service\$endpoint.
| bool saveContentItem | ( | ContentItem & | $contentItem | ) |
Save a content item.
| ContentItem | $contentItem | Content item object |