Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
IMSGlobal\LTI\ToolProvider\ContentItem Class Reference

Public Member Functions

 __construct ($type, $placementAdvice=null, $id=null)
 Class constructor.
 
 setMediaType ($mediaType)
 Set a media type value for the content-item.
 
 setText ($text)
 Set a link text value for the content-item.
 
 setTitle ($title)
 Set a title value for the content-item.
 
 setUrl ($url)
 Set a URL value for the content-item.
 

Static Public Member Functions

static toJson ($items)
 Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type instance.
 

Public Attributes

const LTI_LINK_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltilink'
 Media type for LTI launch links.
 

Constructor & Destructor Documentation

◆ __construct()

IMSGlobal\LTI\ToolProvider\ContentItem::__construct ( $type,
$placementAdvice = null,
$id = null )

Class constructor.

Parameters
string$typeClass type of content-item
ContentItemPlacement$placementAdvicePlacement object for item (optional)
string$idURL of content-item (optional)

Member Function Documentation

◆ setMediaType()

IMSGlobal\LTI\ToolProvider\ContentItem::setMediaType ( $mediaType)

Set a media type value for the content-item.

Parameters
string$mediaTypeMedia type value

◆ setText()

IMSGlobal\LTI\ToolProvider\ContentItem::setText ( $text)

Set a link text value for the content-item.

Parameters
string$textLink text value

◆ setTitle()

IMSGlobal\LTI\ToolProvider\ContentItem::setTitle ( $title)

Set a title value for the content-item.

Parameters
string$titleTitle value

◆ setUrl()

IMSGlobal\LTI\ToolProvider\ContentItem::setUrl ( $url)

Set a URL value for the content-item.

Parameters
string$urlURL value

◆ toJson()

static IMSGlobal\LTI\ToolProvider\ContentItem::toJson ( $items)
static

Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type instance.

Parameters
mixed$itemsAn array of content items or a single item
Return values
string

The documentation for this class was generated from the following file: