Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
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. | |
build (stdClass $user, forum_entity $forum, array $discussions) | |
Build the exported discussion summaries for a given set of discussions. | |
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
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.
renderer_base | $renderer | Core renderer |
legacy_data_mapper_factory | $legacydatamapperfactory | Legacy data mapper factory |
exporter_factory | $exporterfactory | Exporter factory |
vault_factory | $vaultfactory | Vault factory |
manager_factory | $managerfactory | Manager factory |
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.
stdClass | $user | The user to export the posts for. |
forum_entity | $forum | The forum that each of the $discussions belong to |
discussion_summary_entity[] | $discussions | A list of all discussion summaries to export |
stdClass[] | List of exported posts in the same order as the $posts array. |