Class to represent an LTI link content-item object. More...
Public Member Functions | |
| __construct ($placementAdvices=null, $id=null) | |
| Class constructor. | |
| addCustom ($name, $value=null) | |
| Add a custom parameter for the content-item. | |
| setLineItem ($lineItem) | |
| Set a line-item for the content-item. | |
| setAvailable ($available) | |
| Set an availability time period for the content-item. | |
| setSubmission ($submission) | |
| Set a submission time period for the content-item. | |
| setNoUpdate ($noUpdate) | |
| Set whether the content-item should not be allowed to be updated. | |
| toJsonldObject () | |
| Wrap the content item to form an item complying with the application/vnd.ims.lti.v1.contentitems+json media type. | |
| toJsonObject () | |
| Wrap the content items to form a complete value for the https://purl.imsglobal.org/spec/lti-dl/claim/content_items claim. | |
Public Member Functions inherited from Item | |
| __construct ($type, $placementAdvices=null, $id=null) | |
| Class constructor. | |
| setUrl ($url) | |
| Set a URL value for the content-item. | |
| setMediaType ($mediaType) | |
| Set a media type value for the content-item. | |
| setTitle ($title) | |
| Set a title value for the content-item. | |
| setText ($text) | |
| Set a link text value for the content-item. | |
| setHtml ($html) | |
| Set an HTML embed value for the content-item. | |
| addPlacementAdvice ($placementAdvice) | |
| Add a placement for the content-item. | |
| setIcon ($icon) | |
| Set an icon image for the content-item. | |
| setThumbnail ($thumbnail) | |
| Set a thumbnail image for the content-item. | |
| setHideOnCreate ($hideOnCreate) | |
| Set whether the content-item should be hidden from learners by default. | |
Protected Member Functions | |
| fromJsonObject ($item) | |
| Extract content-item details from its JSON representation. | |
| toJsonldObject () | |
| Wrap the content item to form an item complying with the application/vnd.ims.lti.v1.contentitems+json media type. | |
| toJsonObject () | |
| Wrap the content items to form a complete value for the https://purl.imsglobal.org/spec/lti-dl/claim/content_items claim. | |
| fromJsonObject ($item) | |
| Extract content-item details from its JSON representation. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Item | |
| static | toJson ($items, $ltiVersion=Util::LTI_VERSION1) |
| Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type instance. | |
| static | fromJson ($items) |
| Generate an array of Item objects from their JSON representation. | |
| static | fromJsonItem ($item) |
| Generate an Item object from its JSON or JSON-LD representation. | |
Data Fields inherited from Item | |
| const | TYPE_LINK = 'link' |
| Type for link content-item. | |
| const | TYPE_LTI_LINK = 'ltiResourceLink' |
| Type for LTI link content-item. | |
| const | TYPE_LTI_ASSIGNMENT = 'ltiAssignment' |
| Type for LTI assignment content-item. | |
| const | TYPE_FILE = 'file' |
| Type for file content-item. | |
| const | TYPE_HTML = 'html' |
| Type for HTML content-item. | |
| const | TYPE_IMAGE = 'image' |
| Type for image content-item. | |
| const | LTI_LINK_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltilink' |
| Media type for LTI launch links. | |
| const | LTI_ASSIGNMENT_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltiassignment' |
| Media type for LTI assignment links. | |
Class to represent an LTI link content-item object.
Definition at line 12 of file LtiLinkItem.php.
| __construct | ( | $placementAdvices = null, |
|
$id = null |
|||
| ) |
Class constructor.
| Placement[] | Placement | null | $placementAdvices | Array of Placement objects (or single placement object) for item (optional) |
| string | nul | $id | URL of content-item (optional) |
Reimplemented in LtiAssignmentItem.
Definition at line 56 of file LtiLinkItem.php.
References Item\LTI_LINK_MEDIA_TYPE, Item\setMediaType(), and Item\TYPE_LTI_LINK.
| addCustom | ( | $name, | |
$value = null |
|||
| ) |
Add a custom parameter for the content-item.
| string | $name | Name of parameter |
| string | null | $value | Value of parameter |
Definition at line 68 of file LtiLinkItem.php.
Referenced by LtiLinkItem\fromJsonObject().
|
protected |
Extract content-item details from its JSON representation.
| object | $item | A JSON object representing an LTI link content-item |
Reimplemented from Item.
Definition at line 178 of file LtiLinkItem.php.
References LtiLinkItem\addCustom(), LineItem\fromJsonObject(), TimePeriod\fromJsonObject(), LtiLinkItem\setAvailable(), LtiLinkItem\setLineItem(), and LtiLinkItem\setSubmission().
| setAvailable | ( | $available | ) |
Set an availability time period for the content-item.
| TimePeriod | $available | Time period |
Definition at line 94 of file LtiLinkItem.php.
Referenced by LtiLinkItem\fromJsonObject().
| setLineItem | ( | $lineItem | ) |
Set a line-item for the content-item.
| LineItem | $lineItem | Line-item |
Definition at line 84 of file LtiLinkItem.php.
Referenced by LtiLinkItem\fromJsonObject().
| setNoUpdate | ( | $noUpdate | ) |
Set whether the content-item should not be allowed to be updated.
| bool | null | $noUpdate | True if the item should not be updatable |
Definition at line 114 of file LtiLinkItem.php.
| setSubmission | ( | $submission | ) |
Set a submission time period for the content-item.
| TimePeriod | $submission | Time period |
Definition at line 104 of file LtiLinkItem.php.
Referenced by LtiLinkItem\fromJsonObject().
| toJsonldObject | ( | ) |
Wrap the content item to form an item complying with the application/vnd.ims.lti.v1.contentitems+json media type.
Reimplemented from Item.
Definition at line 124 of file LtiLinkItem.php.
| toJsonObject | ( | ) |
Wrap the content items to form a complete value for the https://purl.imsglobal.org/spec/lti-dl/claim/content_items claim.
Reimplemented from Item.
Definition at line 151 of file LtiLinkItem.php.