Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | List of all members
core_privacy\local\request\content_writer Interface Reference

The interface for a Moodle content writer. More...

Inheritance diagram for core_privacy\local\request\content_writer:
core_privacy\local\request\moodle_content_writer core_privacy\tests\request\content_writer

Public Member Functions

 __construct (writer $writer)
 Constructor for the content writer. More...
 
 export_area_files (array $subcontext, $component, $filearea, $itemid)
 Export all files within the specified component, filearea, itemid combination. More...
 
 export_custom_file (array $subcontext, $filename, $filecontent)
 Export a piece of data in a custom format. More...
 
 export_data (array $subcontext, stdClass $data)
 Export the supplied data within the current context, at the supplied subcontext. More...
 
 export_file (array $subcontext, stored_file $file)
 Export the specified file in the target location. More...
 
 export_metadata (array $subcontext, string $name, $value, string $description)
 Export metadata about the supplied subcontext. More...
 
 export_related_data (array $subcontext, $name, $data)
 Export a piece of related data. More...
 
 export_user_preference (string $component, string $key, string $value, string $description)
 Export the specified user preference. More...
 
 finalise_content ()
 Perform any required finalisation steps and return the location of the finalised export. More...
 
 rewrite_pluginfile_urls (array $subcontext, $component, $filearea, $itemid, $text)
 Prepare a text area by processing pluginfile URLs within it. More...
 
 set_context (\context $context)
 Set the context for the current item being processed. More...
 

Detailed Description

The interface for a Moodle content writer.

Constructor & Destructor Documentation

◆ __construct()

core_privacy\local\request\content_writer::__construct ( writer  $writer)

Constructor for the content writer.

Note: The writer_factory must be passed.

Parameters
writer$writerThe factory.

Implemented in core_privacy\local\request\moodle_content_writer.

Member Function Documentation

◆ export_area_files()

core_privacy\local\request\content_writer::export_area_files ( array  $subcontext,
  $component,
  $filearea,
  $itemid 
)

Export all files within the specified component, filearea, itemid combination.

Parameters
array$subcontextThe location within the current context that this data belongs.
string$componentThe name of the component that the files belong to.
string$fileareaThe filearea within that component.
string$itemidWhich item those files belong to.
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_custom_file()

core_privacy\local\request\content_writer::export_custom_file ( array  $subcontext,
  $filename,
  $filecontent 
)

Export a piece of data in a custom format.

Parameters
array$subcontextThe location within the current context that this data belongs.
string$filenameThe name of the file to be exported.
string$filecontentThe content to be exported.
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_data()

core_privacy\local\request\content_writer::export_data ( array  $subcontext,
stdClass  $data 
)

Export the supplied data within the current context, at the supplied subcontext.

Parameters
array$subcontextThe location within the current context that this data belongs.
stdClass$dataThe data to be exported
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_file()

core_privacy\local\request\content_writer::export_file ( array  $subcontext,
stored_file  $file 
)

Export the specified file in the target location.

Parameters
array$subcontextThe location within the current context that this data belongs.
stored_file$fileThe file to be exported.
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_metadata()

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.

Parameters
array$subcontextThe location within the current context that this data belongs.
string$nameThe metadata name.
string$valueThe metadata value.
string$descriptionThe description of the value.
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_related_data()

core_privacy\local\request\content_writer::export_related_data ( array  $subcontext,
  $name,
  $data 
)

Export a piece of related data.

Parameters
array$subcontextThe location within the current context that this data belongs.
string$nameThe name of the file to be exported.
stdClass$dataThe related data to export.
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ export_user_preference()

core_privacy\local\request\content_writer::export_user_preference ( string  $component,
string  $key,
string  $value,
string  $description 
)

Export the specified user preference.

Parameters
string$componentThe name of the component.
string$keyThe name of th key to be exported.
string$valueThe value of the preference
string$descriptionA description of the value
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ finalise_content()

core_privacy\local\request\content_writer::finalise_content ( )

Perform any required finalisation steps and return the location of the finalised export.

Return values
string

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ rewrite_pluginfile_urls()

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.

Parameters
array$subcontextThe location within the current context that this data belongs.
string$componentThe name of the component that the files belong to.
string$fileareaThe filearea within that component.
string$itemidWhich item those files belong to.
string$textThe text to be processed
Return values
stringThe processed string

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.

◆ set_context()

core_privacy\local\request\content_writer::set_context ( \context  $context)

Set the context for the current item being processed.

Parameters
context$contextThe context to use
Return values
content_writer

Implemented in core_privacy\tests\request\content_writer, and core_privacy\local\request\moodle_content_writer.


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