Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Post attachment vault class. More...
Public Member Functions | |
__construct (file_storage $filestorage) | |
Construct. More... | |
get_attachments_for_posts (context $context, array $posts) | |
Get the attachments for the given posts. More... | |
Post attachment vault class.
This should be the only place that accessed the database.
This uses the repository pattern. See: https://designpatternsphp.readthedocs.io/en/latest/More/Repository/README.html
mod_forum\local\vaults\post_attachment::__construct | ( | file_storage | $filestorage | ) |
Construct.
file_storage | $filestorage | File storage |
mod_forum\local\vaults\post_attachment::get_attachments_for_posts | ( | context | $context, |
array | $posts | ||
) |
Get the attachments for the given posts.
The results are indexed by post id.
context | $context | The (forum) context that the posts are in |
post_entity[] | $posts | The list of posts to load attachments for |
array | Post attachments indexed by post id |