Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
The interface for a Moodle content writer. More...
Public Member Functions | |
__construct (writer $writer) | |
Constructor for the content writer. | |
export_area_files (array $subcontext, $component, $filearea, $itemid) | |
Export all files within the specified component, filearea, itemid combination. | |
export_custom_file (array $subcontext, $filename, $filecontent) | |
Export a piece of data in a custom format. | |
export_data (array $subcontext, stdClass $data) | |
Export the supplied data within the current context, at the supplied subcontext. | |
export_file (array $subcontext, stored_file $file) | |
Export the specified file in the target location. | |
export_metadata (array $subcontext, string $name, $value, string $description) | |
Export metadata about the supplied subcontext. | |
export_related_data (array $subcontext, $name, $data) | |
Export a piece of related data. | |
export_user_preference (string $component, string $key, string $value, string $description) | |
Export the specified user preference. | |
finalise_content () | |
Perform any required finalisation steps and return the location of the finalised export. | |
rewrite_pluginfile_urls (array $subcontext, $component, $filearea, $itemid, $text) | |
Prepare a text area by processing pluginfile URLs within it. | |
set_context (\context $context) | |
Set the context for the current item being processed. | |
The interface for a Moodle content writer.
core_privacy\local\request\content_writer::__construct | ( | writer | $writer | ) |
Constructor for the content writer.
Note: The writer_factory must be passed.
writer | $writer | The factory. |
Implemented in core_privacy\local\request\moodle_content_writer.
core_privacy\local\request\content_writer::export_area_files | ( | array | $subcontext, |
$component, | |||
$filearea, | |||
$itemid ) |
Export all files within the specified component, filearea, itemid combination.
array | $subcontext | The location within the current context that this data belongs. |
string | $component | The name of the component that the files belong to. |
string | $filearea | The filearea within that component. |
string | $itemid | Which item those files belong to. |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_custom_file | ( | array | $subcontext, |
$filename, | |||
$filecontent ) |
Export a piece of data in a custom format.
array | $subcontext | The location within the current context that this data belongs. |
string | $filename | The name of the file to be exported. |
string | $filecontent | The content to be exported. |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_data | ( | array | $subcontext, |
stdClass | $data ) |
Export the supplied data within the current context, at the supplied subcontext.
array | $subcontext | The location within the current context that this data belongs. |
stdClass | $data | The data to be exported |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_file | ( | array | $subcontext, |
stored_file | $file ) |
Export the specified file in the target location.
array | $subcontext | The location within the current context that this data belongs. |
stored_file | $file | The file to be exported. |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_metadata | ( | array | $subcontext, |
string | $name, | ||
$value, | |||
string | $description ) |
Export metadata about the supplied subcontext.
Metadata consists of a key/value pair and a description of the value.
array | $subcontext | The location within the current context that this data belongs. |
string | $name | The metadata name. |
string | $value | The metadata value. |
string | $description | The description of the value. |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_related_data | ( | array | $subcontext, |
$name, | |||
$data ) |
Export a piece of related data.
array | $subcontext | The location within the current context that this data belongs. |
string | $name | The name of the file to be exported. |
stdClass | $data | The related data to export. |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::export_user_preference | ( | string | $component, |
string | $key, | ||
string | $value, | ||
string | $description ) |
Export the specified user preference.
string | $component | The name of the component. |
string | $key | The name of th key to be exported. |
string | $value | The value of the preference |
string | $description | A description of the value |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::finalise_content | ( | ) |
Perform any required finalisation steps and return the location of the finalised export.
string |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::rewrite_pluginfile_urls | ( | array | $subcontext, |
$component, | |||
$filearea, | |||
$itemid, | |||
$text ) |
Prepare a text area by processing pluginfile URLs within it.
array | $subcontext | The location within the current context that this data belongs. |
string | $component | The name of the component that the files belong to. |
string | $filearea | The filearea within that component. |
string | $itemid | Which item those files belong to. |
string | $text | The text to be processed |
string | The processed string |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.
core_privacy\local\request\content_writer::set_context | ( | \context | $context | ) |
Set the context for the current item being processed.
context | $context | The context to use |
content_writer |
Implemented in core_privacy\local\request\moodle_content_writer, and core_privacy\tests\request\content_writer.