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

Exported discussion summaries builder class. More...

Public Member Functions

 __construct (renderer_base $renderer, legacy_data_mapper_factory $legacydatamapperfactory, exporter_factory $exporterfactory, vault_factory $vaultfactory, manager_factory $managerfactory)
 Constructor. More...
 
 build (stdClass $user, forum_entity $forum, array $discussions)
 Build the exported discussion summaries for a given set of discussions. More...
 

Detailed Description

Exported discussion summaries builder class.

This class is an implementation of the builder pattern (loosely). It is responsible for taking a set of related forums, discussions, and posts and generate the exported version of the discussion summaries.

It encapsulates the complexity involved with exporting discussions summaries. All of the relevant additional resources will be loaded by this class in order to ensure the exporting process can happen.

See this doc for more information on the builder pattern: https://designpatternsphp.readthedocs.io/en/latest/Creational/Builder/README.html

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

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\builders\exported_discussion_summaries::__construct ( renderer_base  $renderer,
legacy_data_mapper_factory  $legacydatamapperfactory,
exporter_factory  $exporterfactory,
vault_factory  $vaultfactory,
manager_factory  $managerfactory 
)

Constructor.

Parameters
renderer_base$rendererCore renderer
legacy_data_mapper_factory$legacydatamapperfactoryLegacy data mapper factory
exporter_factory$exporterfactoryExporter factory
vault_factory$vaultfactoryVault factory
manager_factory$managerfactoryManager factory

Member Function Documentation

◆ build()

mod_forum\local\builders\exported_discussion_summaries::build ( stdClass  $user,
forum_entity  $forum,
array  $discussions 
)

Build the exported discussion summaries for a given set of discussions.

This will typically be used for a list of discussions in the same forum.

Parameters
stdClass$userThe user to export the posts for.
forum_entity$forumThe forum that each of the $discussions belong to
discussion_summary_entity[]$discussionsA list of all discussion summaries to export
Return values
stdClass[]List of exported posts in the same order as the $posts array.

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