Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core\content\export\exported_item Class Reference

This class describes the files which were exported, and any text content that those files were contained in. More...

Public Member Functions

 __construct (array $files=[])
 Constructor for the exported_item.
 
 add_file (string $relativefilepath, bool $incontent=false, ?string $url=null)
 Add a file to the list of exported files.
 
 add_files (array $files, bool $incontent=false)
 Add a list of files to the list of exported files.
 
 get_all_files ()
 Get a list of all files in the exported item.
 
 get_content ()
 Fetch the rewritten content.
 
 get_content_files ()
 Get a list of all files present in the content.
 
 get_noncontent_files ()
 Get all files which are not already referenced in the content.
 
 get_template_data ()
 Get all template data for this exported item.
 
 get_title ()
 Get a short, descriptive name associated with the exported content, if one is avaiable.
 
 has_any_data ()
 Check whether the exported_item includes any data.
 
 set_content (string $content)
 Set the rewritten content.
 
 set_title (string $title)
 Set a title for this exported item.
 

Protected Attributes

string $content = ''
 Any string content for export

 
string[] $contentfiles = []
 A list of files which were exported and are present in the content.
 
string[] $files = []
 A list of files which were exported and are not present in the content.
 
string $title = null
 A short, descriptive, name for this exported item.
 

Detailed Description

This class describes the files which were exported, and any text content that those files were contained in.

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

Constructor & Destructor Documentation

◆ __construct()

core\content\export\exported_item::__construct ( array $files = [])

Constructor for the exported_item.

Parameters
array$filesA list of all files which were exported

Member Function Documentation

◆ add_file()

core\content\export\exported_item::add_file ( string $relativefilepath,
bool $incontent = false,
?string $url = null )

Add a file to the list of exported files.

Parameters
string$relativefilepathThe path to the content relative to the exported context
bool$incontentWhether this file is included within the content
null | string$urlThe URL to use of the live file where the file could not be stored in the archive

◆ add_files()

core\content\export\exported_item::add_files ( array $files,
bool $incontent = false )

Add a list of files to the list of exported files.

Parameters
string[]$filesThe path to the content relative to the exported context
bool$incontentWhether this file is included within the content

◆ get_all_files()

core\content\export\exported_item::get_all_files ( )

Get a list of all files in the exported item.

Return values
array

◆ get_content()

core\content\export\exported_item::get_content ( )

Fetch the rewritten content.

Return values
string

◆ get_content_files()

core\content\export\exported_item::get_content_files ( )

Get a list of all files present in the content.

That is those files which were exported, and which are referenced in some fashion. These files typically do not need to be listed separately.

Return values
array

◆ get_noncontent_files()

core\content\export\exported_item::get_noncontent_files ( )

Get all files which are not already referenced in the content.

These files will typically be displayed in a separate list.

Return values
array

◆ get_template_data()

core\content\export\exported_item::get_template_data ( )

Get all template data for this exported item.

Return values
stdClass

◆ get_title()

core\content\export\exported_item::get_title ( )

Get a short, descriptive name associated with the exported content, if one is avaiable.

Return values
null|string

◆ has_any_data()

core\content\export\exported_item::has_any_data ( )

Check whether the exported_item includes any data.

Return values
bool

◆ set_content()

core\content\export\exported_item::set_content ( string $content)

Set the rewritten content.

Parameters
string$content

◆ set_title()

core\content\export\exported_item::set_title ( string $title)

Set a title for this exported item.

Parameters
string$title

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