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

Post exporter class.

Copyright: 2019 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 674 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: post  - X-Ref

Post exporter class.

__construct(post_entity $post, array $related = [])   X-Ref
Constructor.

param: post_entity $post The post to export
param: array $related List of related data

define_other_properties()   X-Ref
Return the list of additional properties.

return: array

get_other_values(renderer_base $output)   X-Ref
Get the additional values to inject while exporting.

param: renderer_base $output The renderer.
return: array Keys are the property names, values are their values.

define_related()   X-Ref
Returns a list of objects that are related.

return: array

get_format_parameters_for_message()   X-Ref
This method returns the parameters for the post's message to
use with the function external_format_text().

return: array

get_message(post_entity $post)   X-Ref
Get the message text from a post.

param: post_entity $post The post
return: string

export_attachments(array $attachments, post_entity $post, renderer_base $output, bool $canexport)   X-Ref
Get the exported attachments for a post.

param: stored_file[] $attachments The list of attachments for the post
param: post_entity $post The post being exported
param: renderer_base $output Renderer base
param: bool $canexport If the user can export the post (relates to portfolios not exporters like this class)
return: array

export_tags(array $tags)   X-Ref
Export the list of tags.

param: core_tag_tag[] $tags List of tags to export
return: array

get_author_subheading_html(stdClass $exportedauthor, int $timecreated)   X-Ref
Get the HTML to display as a subheading in a post.

param: stdClass $exportedauthor The exported author object
param: int $timecreated The post time created timestamp if it's to be displayed
return: string

get_start_time(discussion_entity $discussion, post_entity $post)   X-Ref
Get the start time for a post.

param: discussion_entity $discussion entity
param: post_entity $post entity
return: int The start time (timestamp) for a post