An object used to represent content which can be served.
More...
|
static | create_from_area_params (context $context, string $component, string $filearea, ?int $itemid, ?int $pluginfileitemid=null, string $folderpath='') |
| Create a set of exportable_items from a set of area paramaters as passed to get_areas_files().
|
|
|
string | $component = null |
| The component being exported.
|
|
context | $context = null |
| The context associated with this exportable item.
|
|
stored_file | $file |
| The file to be exported.
|
|
string | $folderpath |
| The destination path of the text content.
|
|
int | $pluginfileitemid |
| The itemid to use in the pluginfile URL.
|
|
string | $uservisiblename = null |
| The name displayed to the user.
|
|
An object used to represent content which can be served.
- Copyright
- 2020 Andrew Nicols andre.nosp@m.w@ni.nosp@m.cols..nosp@m.co.u.nosp@m.k
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core\content\export\exportable_items\exportable_stored_file::__construct |
( |
context | $context, |
|
|
string | $component, |
|
|
string | $uservisiblename, |
|
|
stored_file | $file, |
|
|
?int | $pluginfileitemid = null, |
|
|
string | $folderpath = '' ) |
Create a new exportable_item instance.
If no filearea or itemid is specified the no attempt will be made to export files.
- Parameters
-
context | $context | The context that this content belongs to |
string | $component | |
string | $uservisiblename | The name displayed to the user when filtering |
stored_file | $file | |
null | int | $pluginfileitemid | The itemid as used in the pluginfile URL. If no itemid is used, then a null value can be provided |
string | $folderpath | Any sub-directory to place files in |
◆ add_to_archive()
core\content\export\exportable_items\exportable_stored_file::add_to_archive |
( |
zipwriter | $archive | ) |
|
◆ create_from_area_params()
static core\content\export\exportable_items\exportable_stored_file::create_from_area_params |
( |
context | $context, |
|
|
string | $component, |
|
|
string | $filearea, |
|
|
?int | $itemid, |
|
|
?int | $pluginfileitemid = null, |
|
|
string | $folderpath = '' ) |
|
static |
Create a set of exportable_items from a set of area paramaters as passed to get_areas_files().
If no filearea or itemid is specified the no attempt will be made to export files.
- Parameters
-
context | $context | The context that this content belongs to |
string | $component | |
string | $filearea | |
null | int | $itemid | |
null | int | $pluginfileitemid | The itemid as used in the pluginfile URL. If no itemid is used, then a null value can be provided |
string | $folderpath | Any sub-directory to place files in |
- Return values
-
◆ get_component()
core\content\export\exportable_item::get_component |
( |
| ) |
|
|
inherited |
Get the component that this exportable item relates to.
- Return values
-
◆ get_context()
core\content\export\exportable_item::get_context |
( |
| ) |
|
|
inherited |
Get the context that this exportable item is for.
- Return values
-
◆ get_filepath_for_file()
core\content\export\exportable_items\exportable_stored_file::get_filepath_for_file |
( |
| ) |
|
|
protected |
Get the filepath for the specified stored_file.
- Return values
-
◆ get_pluginfile_url_for_stored_file()
static core\content\export\exportable_items\exportable_stored_file::get_pluginfile_url_for_stored_file |
( |
stored_file | $file, |
|
|
?int | $pluginfileitemid ) |
|
staticprotected |
Get the pluginfile URL for a stored file.
Note: The itemid in the pluginfile may be omitted in some URLs, despite an itemid being present in the database. Equally, the itemid in the URL may not match the itemid in the files table.
The pluginfileitemid argument provided to this function is the variant in the URL, and not the one in the files table.
- Parameters
-
stored_file | $file | The file whose link will be generated |
null | int | $pluginfileitemid | The itemid of the file in pluginfile URL. |
◆ 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
-
The documentation for this class was generated from the following file:
- lib/classes/content/export/exportable_items/exportable_stored_file.php