32        $this->{
'@type'} = 
$type;
 
   33        if (is_object($placementAdvice) && (count(get_object_vars($placementAdvice)) > 0)) {
 
   34            $this->placementAdvice = $placementAdvice;
 
   66        if (!empty($mediaType)) {
 
   67            $this->mediaType = $mediaType;
 
   69            unset($this->mediaType);
 
   84        } 
else if (isset($this->title)) {
 
  100        } 
else if (isset($this->text)) {
 
  125        $obj = new \stdClass();
 
  126        $obj->{
'@context'} = 
'http://purl.imsglobal.org/ctx/lti/v1/ContentItem';
 
  127        if (!is_array($items)) {
 
  128          $obj->{
'@graph'} = array();
 
  129          $obj->{
'@graph'}[] = $items;
 
  131          $obj->{
'@graph'} = $items;
 
  134        return json_encode($obj);
 
An exception for terminatinating execution or to throw for unit testing.
Class to represent a content-item object.
setTitle($title)
Set a title value for the content-item.
setText($text)
Set a link text value for the content-item.
__construct($type, $placementAdvice=null, $id=null)
Class constructor.
static toJson($items)
Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type ins...
setMediaType($mediaType)
Set a media type value for the content-item.
const LTI_LINK_MEDIA_TYPE
Media type for LTI launch links.
setUrl($url)
Set a URL value for the content-item.
if(!array_key_exists('StateId', $_REQUEST)) $id