Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]

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: 159 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.