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 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 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.