Class to implement the Link and Content service.
More...
|
|
const | MEDIA_TYPE_CONTENT_ITEM = 'application/json' |
| | Content item media type.
|
|
const | MEDIA_TYPE_CONTENT_ITEMS = 'application/json' |
| | Content item container media type.
|
|
bool | $unsigned = false |
| | Whether service request should be sent unsigned.
|
|
|
static string | $SCOPE_READ = 'https://purl.imsglobal.org/spec/lti/scope/contentitem.read' |
| | Read access scope.
|
|
static string | $SCOPE_CREATE = 'https://purl.imsglobal.org/spec/lti/scope/contentitem.create' |
| | Read access scope.
|
|
static string | $SCOPE_UPDATE = 'https://purl.imsglobal.org/spec/lti/scope/contentitem.update' |
| | Update access scope.
|
|
static string | $SCOPE_DELETE = 'https://purl.imsglobal.org/spec/lti/scope/contentitem.delete' |
| | Delete access scope.
|
|
static int | $defaultLimit = null |
| | Default limit on size of container to be returned from requests.
|
|
| array | parseContextsInArray (object|array $contexts, array $arr) |
| | Parse the JSON for context references.
|
|
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.
- Author
- Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
- Copyright
- SPV Software Products
- Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3
◆ __construct()
| __construct |
( |
Platform | $platform, |
|
|
string | $endpoint, |
|
|
?int | $limit = null, |
|
|
bool | $pagingMode = false ) |
Class constructor.
- Parameters
-
| 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 |
◆ createContentItem()
Create a new content item.
- Parameters
-
| ContentItem | $contentItem | Content item object |
- Returns
- bool True if successful
◆ deleteContentItem()
| bool deleteContentItem |
( |
| ) |
|
Delete a content item.
- Returns
- bool True if successful
◆ get()
Retrieve a content item.
- Returns
- ContentItem|bool ContentItem object, or false on error
◆ getAll()
| 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.
- Parameters
-
| 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) |
- Returns
- ContentItem[]|bool Array of ContentItem objects or false on error
◆ saveContentItem()
Save a content item.
- Parameters
-
| ContentItem | $contentItem | Content item object |
- Returns
- bool True if successful