Class to implement the Line-item service.
More...
|
| __construct (Platform $platform, string $endpoint, ?int $limit=null, bool $pagingMode=false) |
| Class constructor.
|
|
LTI LineItem[] bool | getAll (?string $ltiResourceLinkId=null, ?string $resourceId=null, ?string $tag=null, ?int $limit=null) |
| Retrieve all line-items.
|
|
bool | createLineItem (LTI\LineItem $lineItem) |
| Create a new line-item.
|
|
bool | saveLineItem (LTI\LineItem $lineItem) |
| Save a line-item.
|
|
bool | deleteLineItem (LTI\LineItem $lineItem) |
| Delete a line-item.
|
|
LTI LineItem bool | get () |
| Retrieve a line-item.
|
|
| __construct (Platform $platform, string $endpoint, string $path='') |
| Class constructor.
|
|
| __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.
|
|
|
const | MEDIA_TYPE_LINE_ITEM = 'application/vnd.ims.lis.v2.lineitem+json' |
| Line-item media type.
|
|
const | MEDIA_TYPE_LINE_ITEMS = 'application/vnd.ims.lis.v2.lineitemcontainer+json' |
| Line-item container media type.
|
|
bool | $unsigned = false |
| Whether service request should be sent unsigned.
|
|
|
static string | $SCOPE = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem' |
| Access scope.
|
|
static string | $SCOPE_READONLY = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly' |
| Read-only 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 Line-item 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 line-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 |
◆ createLineItem()
Create a new line-item.
- Parameters
-
LTI\LineItem | $lineItem | Line-item object |
- Returns
- bool True if successful
◆ deleteLineItem()
Delete a line-item.
- Parameters
-
LTI\LineItem | $lineItem | Line-item object |
- Returns
- bool True if successful
◆ get()
◆ getAll()
LTI LineItem[] bool getAll |
( |
?string | $ltiResourceLinkId = null, |
|
|
?string | $resourceId = null, |
|
|
?string | $tag = null, |
|
|
?int | $limit = null ) |
Retrieve all line-items.
The returned items can be filtered by a resource link ID, a resource ID and/or a tag. 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) |
string | null | $resourceId | Tool resource ID (optional) |
string | null | $tag | Tag (optional) |
int | null | $limit | Limit of line-items to be returned in each request, null for service default (optional) |
- Returns
- LTI\LineItem[]|bool Array of LineItem objects or false on error
◆ getLineItem()
Retrieve a line-item.
- Deprecated
- Use LineItem::fromEndpoint() or get() instead
- Parameters
-
Platform | $platform | Platform object for this service request |
string | $endpoint | Line-item endpoint |
- Returns
- LTI\LineItem|bool LineItem object, or false on error
◆ saveLineItem()
Save a line-item.
- Parameters
-
LTI\LineItem | $lineItem | Line-item object |
- Returns
- bool True if successful
References Service\send().