Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core\content\export\exportable_items\exportable_textarea Class Reference

The definition of a text area which can be exported. More...

Inheritance diagram for core\content\export\exportable_items\exportable_textarea:
core\content\export\exportable_item

Public Member Functions

 __construct (context $context, string $component, string $uservisiblename, string $tablename, string $textfield, int $id, ?string $textformatfield=null, ?string $filearea=null, ?int $itemid=null, ?int $pluginfileitemid=null)
 Create a new exportable_item instance.
 
 add_to_archive (zipwriter $archive)
 Add the content to the archive.
 
 get_component ()
 Get the component that this exportable item relates to.
 
 get_context ()
 Get the context that this exportable item is for.
 
 get_user_visible_name ()
 Get the user visible name for the exportable item.
 

Protected Member Functions

 may_include_files ()
 Whether files may be included in this textarea.
 

Protected Attributes

string $component = null
 The component being exported.
 
context $context = null
 The context associated with this exportable item.
 
null string $filearea
 The name of a file area for this content.
 
int $id
 The id in the table.
 
null int $itemid
 The itemid for files in this text field.
 
null int $pluginfileitemid
 The itemid used for constructing pluginfiles.
 
string $tablename
 The name of the table that ha the textarea within it.
 
string $textfield
 The name of the text field within the table.
 
null string $textformatfield
 The name of the format field relating to the text field.
 
string $uservisiblename = null
 The name displayed to the user.
 

Detailed Description

The definition of a text area which can be exported.

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

Constructor & Destructor Documentation

◆ __construct()

core\content\export\exportable_items\exportable_textarea::__construct ( context $context,
string $component,
string $uservisiblename,
string $tablename,
string $textfield,
int $id,
?string $textformatfield = null,
?string $filearea = null,
?int $itemid = null,
?int $pluginfileitemid = null )

Create a new exportable_item instance.

If no filearea or itemid is specified the no attempt will be made to export files.

Parameters
context$contextThe context that this content belongs to
string$componentThe component that this textarea belongs to
string$uservisiblenameThe name displayed to the user when filtering
string$tablenameThe name of the table that this textarea is in
string$textfieldThe field within the tbale
int$idThe id in the database
null | string$textformatfieldThe field in the database relating to the format field if one is present
null | string$fileareaThe name of the file area for files associated with this text area
null | int$itemidThe itemid for files associated with this text area
null | int$pluginfileitemidThe itemid to use when constructing the pluginfile URL Some fileareas do not use any itemid in the URL and should therefore provide a null value here.

Member Function Documentation

◆ add_to_archive()

core\content\export\exportable_items\exportable_textarea::add_to_archive ( zipwriter $archive)

Add the content to the archive.

Parameters
zipwriter$archive

Reimplemented from core\content\export\exportable_item.

◆ get_component()

core\content\export\exportable_item::get_component ( )
inherited

Get the component that this exportable item relates to.

Return values
string

◆ get_context()

core\content\export\exportable_item::get_context ( )
inherited

Get the context that this exportable item is for.

Return values
context

◆ get_user_visible_name()

core\content\export\exportable_item::get_user_visible_name ( )
inherited

Get the user visible name for the exportable item.

Return values
string

◆ may_include_files()

core\content\export\exportable_items\exportable_textarea::may_include_files ( )
protected

Whether files may be included in this textarea.

Both a filearea, and itemid are required for files to be exportable.

Return values
bool

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