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.

mod_forum data generator

Copyright: 2012 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 378 lines (12 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class

mod_forum_generator:: (7 methods):
  reset()
  create_instance()
  create_subscription()
  create_discussion()
  create_post()
  create_content()
  get_author_subheading_html()


Class: mod_forum_generator  - X-Ref

Forum module data generator class

reset()   X-Ref
To be called from data reset code only,
do not use in tests.

return: void

create_instance($record = null, array $options = null)   X-Ref
No description

create_subscription($record = null)   X-Ref
Function to create a dummy subscription.

param: array|stdClass $record
return: stdClass the subscription object

create_discussion($record = null)   X-Ref
Function to create a dummy discussion.

param: array|stdClass $record
return: stdClass the discussion object

create_post($record = null)   X-Ref
Function to create a dummy post.

param: array|stdClass $record
return: stdClass the post object

create_content($instance, $record = array()   X-Ref
No description

get_author_subheading_html(stdClass $exportedauthor, int $timecreated)   X-Ref
Extracted from exporter/post.php

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