Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
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. More...
 
 get_discussion_from_stdclass (stdClass $record)
 Create a discussion entity from an stdClass (legacy dicussion object). More...
 
 get_discussion_summary_from_stdclass (stdClass $discussion, stdClass $firstpost, stdClass $firstpostauthor, stdClass $latestpostauthor)
 Create a discussion summary enttiy from stdClasses. More...
 
 get_exported_posts_sorter ()
 Create a sorter entity to sort exported posts. More...
 
 get_forum_from_stdclass (stdClass $record, context $context, stdClass $coursemodule, stdClass $course)
 Create a forum entity from a stdClass (legacy forum object). More...
 
 get_post_from_stdclass (stdClass $record)
 Create a post entity from an stdClass (legacy post object). More...
 
 get_post_read_receipt_collection_from_stdclasses (array $records)
 Create a post read receipt collection entity from a list of read receipt records. More...
 
 get_posts_sorter ()
 Create a sorter entity to sort post entities. More...
 

Detailed Description

Entity factory to create the forum entities.

See: https://designpatternsphp.readthedocs.io/en/latest/Creational/SimpleFactory/README.html

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

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: