Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
mod_forum\local\vaults\post_attachment Class Reference

Post attachment vault class. More...

Public Member Functions

 __construct (file_storage $filestorage)
 Construct.
 
 get_attachments_for_posts (context $context, array $posts)
 Get attachment for posts.
 
 get_inline_attachments_for_posts (context $context, array $posts)
 Get inline attachments for posts.
 

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 attachment for posts.

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

◆ get_inline_attachments_for_posts()

mod_forum\local\vaults\post_attachment::get_inline_attachments_for_posts ( context $context,
array $posts )

Get inline attachments for posts.

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: