Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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: 1 time
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