Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

(no description)

File Size: 138 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ContentItem:: (6 methods):
  __construct()
  setUrl()
  setMediaType()
  setTitle()
  setText()
  toJson()


Class: ContentItem  - X-Ref

Class to represent a content-item object

__construct($type, $placementAdvice = null, $id = null)   X-Ref
Class constructor.

param: string $type Class type of content-item
param: ContentItemPlacement $placementAdvice  Placement object for item (optional)
param: string $id   URL of content-item (optional)

setUrl($url)   X-Ref
Set a URL value for the content-item.

param: string $url  URL value

setMediaType($mediaType)   X-Ref
Set a media type value for the content-item.

param: string $mediaType  Media type value

setTitle($title)   X-Ref
Set a title value for the content-item.

param: string $title  Title value

setText($text)   X-Ref
Set a link text value for the content-item.

param: string $text  Link text value

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

param: mixed $items An array of content items or a single item
return: string