Class to represent a content-item object

author Stephen P Vickers
version 2.5.00
license GNU Lesser General Public License, version 3
package LTI

 Methods

Class constructor.

__construct(string $type, \LTI_Content_Item_Placement $placementAdvice = NULL, string $id = NULL

Parameters

$type

string

Class type of content-item

$placementAdvice

\LTI_Content_Item_Placement

Placement object for item (optional)

$id

string

URL of content-item (optional)

Set a media type value for the content-item.

setMediaType(string $mediaType) 

Parameters

$mediaType

string

Media type value

Set a link text value for the content-item.

setText(string $text) 

Parameters

$text

string

Link text value

Set a title value for the content-item.

setTitle(string $title) 

Parameters

$title

string

Title value

Set a URL value for the content-item.

setUrl(string $url) 

Parameters

$url

string

URL value

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

toJson(mixed $items) 
Static

Parameters

$items

mixed

An array of content items or a single item

 Constants