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.

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