Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | List of all members
mod_forum\local\factories\exporter Class Reference

The exporter factory class used to fetch an instance of the different exporter types. More...

Public Member Functions

 __construct (legacy_data_mapper_factory $legacydatamapperfactory, manager_factory $managerfactory, url_factory $urlfactory, vault_factory $vaultfactory)
 Constructor for the exporter factory. More...
 
 get_discussion_exporter (stdClass $user, forum_entity $forum, discussion_entity $discussion, array $groupsbyid=[], array $favouriteids=[])
 Construct a new discussion exporter for the specified user and forum discussion. More...
 
 get_discussion_summaries_exporter (stdClass $user, forum_entity $forum, array $discussions, array $groupsbyid=[], array $groupsbyauthorid=[], array $discussionreplycount=[], array $discussionunreadcount=[], array $latestpostids=[], array $postauthorcontextids=[], array $favourites=[], array $latestauthors=[])
 Construct a new discussion summaries exporter for the specified user and set of discussions. More...
 
 get_forum_exporter (stdClass $user, forum_entity $forum, ?int $currentgroup)
 Construct a new forum exporter for the specified user and forum. More...
 
 get_posts_exporter (stdClass $user, forum_entity $forum, discussion_entity $discussion, array $posts, array $authorsbyid=[], array $authorcontextids=[], array $attachmentsbypostid=[], array $groupsbyauthorid=[], post_read_receipt_collection_entity $readreceiptcollection=null, array $tagsbypostid=[], array $ratingbypostid=[], bool $includehtml=false)
 Construct a new post exporter for the specified user and set of post. More...
 

Static Public Member Functions

static get_discussion_export_structure ()
 Fetch the structure of the discussion exporter. More...
 
static get_discussion_summaries_export_structure ()
 Fetch the structure of the discussion summaries exporter. More...
 
static get_forum_export_structure ()
 Fetch the structure of the forum exporter. More...
 
static get_posts_export_structure ()
 Fetch the structure of the posts exporter. More...
 

Detailed Description

The exporter factory class used to fetch an instance of the different exporter types.

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

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

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\factories\exporter::__construct ( legacy_data_mapper_factory  $legacydatamapperfactory,
manager_factory  $managerfactory,
url_factory  $urlfactory,
vault_factory  $vaultfactory 
)

Constructor for the exporter factory.

Parameters
legacy_data_mapper_factory$legacydatamapperfactoryThe factory to fetch a legacy data mapper instance
manager_factory$managerfactoryThe factory fo fetch a manager instance
url_factory$urlfactoryThe factory to create urls
vault_factory$vaultfactoryThe vault factory

Member Function Documentation

◆ get_discussion_export_structure()

static mod_forum\local\factories\exporter::get_discussion_export_structure ( )
static

Fetch the structure of the discussion exporter.

Return values
array

◆ get_discussion_exporter()

mod_forum\local\factories\exporter::get_discussion_exporter ( stdClass  $user,
forum_entity  $forum,
discussion_entity  $discussion,
array  $groupsbyid = [],
array  $favouriteids = [] 
)

Construct a new discussion exporter for the specified user and forum discussion.

Parameters
stdClass$userThe user viewing the forum
forum_entity$forumThe forum being viewed
discussion_entity$discussionThe discussion being viewed
stdClass[]$groupsbyidThe list of groups in the forum
Return values
discussion_exporter

◆ get_discussion_summaries_export_structure()

static mod_forum\local\factories\exporter::get_discussion_summaries_export_structure ( )
static

Fetch the structure of the discussion summaries exporter.

Return values
array

◆ get_discussion_summaries_exporter()

mod_forum\local\factories\exporter::get_discussion_summaries_exporter ( stdClass  $user,
forum_entity  $forum,
array  $discussions,
array  $groupsbyid = [],
array  $groupsbyauthorid = [],
array  $discussionreplycount = [],
array  $discussionunreadcount = [],
array  $latestpostids = [],
array  $postauthorcontextids = [],
array  $favourites = [],
array  $latestauthors = [] 
)

Construct a new discussion summaries exporter for the specified user and set of discussions.

Parameters
stdClass$userThe user viewing the forum
forum_entity$forumThe forum being viewed
discussion_summary_entity[]$discussionsThe set of discussion summaries to export
stdClass[]$groupsbyauthoridThe set of groups in an associative array for each author
stdClass[]$groupsbyidThe set of groups in the forum in an associative array for each group
int[]$discussionreplycountThe number of replies for each discussion
int[]$discussionunreadcountThe number of unread posts for each discussion
int[]$latestpostidsThe latest post id for each discussion
int[]$postauthorcontextidsThe context ids for the first and last post authors (indexed by author id)
int[]$favouritesThe list of discussion ids that have been favourited
Return values
discussion_summaries_exporter

◆ get_forum_export_structure()

static mod_forum\local\factories\exporter::get_forum_export_structure ( )
static

Fetch the structure of the forum exporter.

Return values
array

◆ get_forum_exporter()

mod_forum\local\factories\exporter::get_forum_exporter ( stdClass  $user,
forum_entity  $forum,
?int  $currentgroup 
)

Construct a new forum exporter for the specified user and forum.

Parameters
stdClass$userThe user viewing the forum
forum_entity$forumThe forum being viewed
int$currentgroupThe group currently being viewed
Return values
forum_exporter

◆ get_posts_export_structure()

static mod_forum\local\factories\exporter::get_posts_export_structure ( )
static

Fetch the structure of the posts exporter.

Return values
array

◆ get_posts_exporter()

mod_forum\local\factories\exporter::get_posts_exporter ( stdClass  $user,
forum_entity  $forum,
discussion_entity  $discussion,
array  $posts,
array  $authorsbyid = [],
array  $authorcontextids = [],
array  $attachmentsbypostid = [],
array  $groupsbyauthorid = [],
post_read_receipt_collection_entity  $readreceiptcollection = null,
array  $tagsbypostid = [],
array  $ratingbypostid = [],
bool  $includehtml = false 
)

Construct a new post exporter for the specified user and set of post.

Parameters
stdClass$userThe user viewing the forum
forum_entity$forumThe forum being viewed
discussion_entity$discussionThe discussion that the post is in
post_entity[]$postsThe set of posts to be exported
author_entity[]$authorsbyidList of authors indexed by author id
int[]$authorcontextidsList of authors context ids indexed by author id
array$attachmentsbypostidList of attachments for each post indexed by post id
array$groupsbyauthoridList of groups for the post authors indexed by author id
post_read_receipt_collection_entity | null$readreceiptcollectionDetails of read receipts for each post
array$tagsbypostidList of tags for each post indexed by post id
rating[]$ratingbypostidList of ratings for each post indexed by post id
bool$includehtmlInclude some pre-constructed HTML in the export
Return values
post_exporter

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