Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Contains the course_content_item_exporter class.

Copyright: 2020 Jake Dallimore <jrhdallimore@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 157 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

course_content_item_exporter:: (5 methods):
  __construct()
  define_properties()
  define_other_properties()
  get_other_values()
  define_related()


Class: course_content_item_exporter  - X-Ref

The course_content_item_exporter class.

__construct(content_item $contentitem, array $related = [])   X-Ref
The course_content_item_exporter constructor.

param: content_item $contentitem the content item to export.
param: array $related the array of related objects used during export.

define_properties()   X-Ref
Definition of all properties originating in the export target, \core_course\local\entity\content_item.

return: array The array of property values, indexed by name.

define_other_properties()   X-Ref
Definition of all properties which are either calculated or originate in a related domain object.

return: array The array of property values, indexed by name.

get_other_values(\renderer_base $output)   X-Ref
Get ALL properties for the content_item DTO being exported.

These properties are a mix of:
- readonly properties of the primary object (content_item) being exported.
- calculated values
- properties originating from the related domain objects.

Normally, those properties defined in get_properties() are added to the export automatically as part of the superclass code,
provided they are public properties on the export target. In this case, the export target is content_item, which doesn't
provide public access to its properties, so those are fetched via their respective getters here.

param: \renderer_base $output
return: array The array of property values, indexed by name.

define_related()   X-Ref
Define the list of related objects, used by this exporter.

return: array the list of related objects.