LTI Integration Library  3.1.0
PHP class library for building LTI integrations
ContentItem Class Reference

Class to represent a content-item object. More...

Public Member Functions

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

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. More...
 

Data Fields

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

Detailed Description

Class to represent a content-item object.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Version
3.1.0
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Definition at line 13 of file ContentItem.php.

Constructor & Destructor Documentation

◆ __construct()

__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)

Definition at line 28 of file ContentItem.php.

Member Function Documentation

◆ setMediaType()

setMediaType (   $mediaType)

Set a media type value for the content-item.

Parameters
string$mediaTypeMedia type value

Definition at line 58 of file ContentItem.php.

◆ setText()

setText (   $text)

Set a link text value for the content-item.

Parameters
string$textLink text value

Definition at line 86 of file ContentItem.php.

◆ setTitle()

setTitle (   $title)

Set a title value for the content-item.

Parameters
string$titleTitle value

Definition at line 72 of file ContentItem.php.

◆ setUrl()

setUrl (   $url)

Set a URL value for the content-item.

Parameters
string$urlURL value

Definition at line 44 of file ContentItem.php.

◆ toJson()

static 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
Returns
string

Definition at line 102 of file ContentItem.php.

Field Documentation

◆ LTI_LINK_MEDIA_TYPE

const LTI_LINK_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltilink'

Media type for LTI launch links.

Definition at line 19 of file ContentItem.php.


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