Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
mod_forum\local\vaults\post_attachment Class Reference

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...
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\vaults\post_attachment::__construct ( file_storage  $filestorage)

Construct.

Parameters
file_storage$filestorageFile storage

Member Function Documentation

◆ get_attachments_for_posts()

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.

Parameters
context$contextThe (forum) context that the posts are in
post_entity[]$postsThe list of posts to load attachments for
Return values
arrayPost attachments indexed by post id

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