LTI Tool Provider Library  3.0.2
PHP class library for building LTI Tool Providers
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 svick.nosp@m.ers@.nosp@m.imsgl.nosp@m.obal.nosp@m..org
Date
2016
Version
3.0.2
Licence:
http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0

Definition at line 14 of file ContentItem.php.

Constructor & Destructor Documentation

__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 29 of file ContentItem.php.

Member Function Documentation

setMediaType (   $mediaType)

Set a media type value for the content-item.

Parameters
string$mediaTypeMedia type value

Definition at line 63 of file ContentItem.php.

setText (   $text)

Set a link text value for the content-item.

Parameters
string$textLink text value

Definition at line 95 of file ContentItem.php.

setTitle (   $title)

Set a title value for the content-item.

Parameters
string$titleTitle value

Definition at line 79 of file ContentItem.php.

setUrl (   $url)

Set a URL value for the content-item.

Parameters
string$urlURL value

Definition at line 47 of file ContentItem.php.

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 112 of file ContentItem.php.

Field Documentation

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

Media type for LTI launch links.

Definition at line 20 of file ContentItem.php.


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