Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
mod_forum\local\factories\entity Class Reference

Entity factory to create the forum entities. More...

Public Member Functions

 get_author_from_stdclass (stdClass $record)
 Create an author entity from a user record.
 
 get_discussion_from_stdclass (stdClass $record)
 Create a discussion entity from an stdClass (legacy dicussion object).
 
 get_discussion_summary_from_stdclass (stdClass $discussion, stdClass $firstpost, stdClass $firstpostauthor, stdClass $latestpostauthor)
 Create a discussion summary enttiy from stdClasses.
 
 get_exported_posts_sorter ()
 Create a sorter entity to sort exported posts.
 
 get_forum_from_stdclass (stdClass $record, context $context, stdClass $coursemodule, stdClass $course)
 Create a forum entity from a stdClass (legacy forum object).
 
 get_post_from_stdclass (stdClass $record)
 Create a post entity from an stdClass (legacy post object).
 
 get_post_read_receipt_collection_from_stdclasses (array $records)
 Create a post read receipt collection entity from a list of read receipt records.
 
 get_posts_sorter ()
 Create a sorter entity to sort post entities.
 

Detailed Description

Member Function Documentation

◆ get_author_from_stdclass()

mod_forum\local\factories\entity::get_author_from_stdclass ( stdClass $record)

Create an author entity from a user record.

Parameters
stdClass$recordThe user record
Return values
author_entity

◆ get_discussion_from_stdclass()

mod_forum\local\factories\entity::get_discussion_from_stdclass ( stdClass $record)

Create a discussion entity from an stdClass (legacy dicussion object).

Parameters
stdClass$recordDiscussion record
Return values
discussion_entity

◆ get_discussion_summary_from_stdclass()

mod_forum\local\factories\entity::get_discussion_summary_from_stdclass ( stdClass $discussion,
stdClass $firstpost,
stdClass $firstpostauthor,
stdClass $latestpostauthor )

Create a discussion summary enttiy from stdClasses.

Parameters
stdClass$discussionThe discussion record
stdClass$firstpostA post record for the first post in the discussion
stdClass$firstpostauthorA user record for the author of the first post
stdClass$latestpostauthorA user record for the author of the latest post in the discussion
Return values
discussion_summary_entity

◆ get_exported_posts_sorter()

mod_forum\local\factories\entity::get_exported_posts_sorter ( )

Create a sorter entity to sort exported posts.

Return values
sorter_entity

◆ get_forum_from_stdclass()

mod_forum\local\factories\entity::get_forum_from_stdclass ( stdClass $record,
context $context,
stdClass $coursemodule,
stdClass $course )

Create a forum entity from a stdClass (legacy forum object).

Parameters
stdClass$recordThe forum record
context$contextThe forum module context
stdClass$coursemoduleCourse module record for the forum
stdClass$courseCourse the forum belongs to
Return values
forum_entity

◆ get_post_from_stdclass()

mod_forum\local\factories\entity::get_post_from_stdclass ( stdClass $record)

Create a post entity from an stdClass (legacy post object).

Parameters
stdClass$recordThe post record
Return values
post_entity

◆ get_post_read_receipt_collection_from_stdclasses()

mod_forum\local\factories\entity::get_post_read_receipt_collection_from_stdclasses ( array $records)

Create a post read receipt collection entity from a list of read receipt records.

Parameters
array$recordsA list of read receipt records.
Return values
post_read_receipt_collection_entity

◆ get_posts_sorter()

mod_forum\local\factories\entity::get_posts_sorter ( )

Create a sorter entity to sort post entities.

Return values
sorter_entity

The documentation for this class was generated from the following file: