|
| __construct (string $importfilepath, string $importfilename) |
| Creates an entries_importer object.
|
|
| get_data_file_content () |
| Returns the file content of the data file.
|
|
| get_file_content_from_zip (string $filename, string $zipsubdir='files/') |
| Returns the file content from a file which has been stored in the zip archive.
|
|
| get_import_data_file_extension () |
| Return the file extension of the import data file which is being used, for example 'csv' for a csv entries_importer.
|
|
|
string string | $importfilename |
| The original name of the import file name including extension of the file which data should be imported from.
|
|
string string | $importfilepath |
| The import file path of the file which data should be imported from.
|
|
string string | $importfiletype |
| $importfiletype The file type of the import file.
|
|
◆ __construct()
mod_data\local\importer\entries_importer::__construct |
( |
string | $importfilepath, |
|
|
string | $importfilename ) |
Creates an entries_importer object.
This object can be used to import data from data files (like csv) and zip archives both including a data file and files to be stored in the course module context.
- Parameters
-
string | $importfilepath | the complete path of the import file including filename |
string | $importfilename | the import file name as uploaded by the user |
- Exceptions
-
◆ get_data_file_content()
mod_data\local\importer\entries_importer::get_data_file_content |
( |
| ) |
|
Returns the file content of the data file.
Returns the content of the file directly if the entries_importer's file is a data file itself. If the entries_importer's file is a zip archive, the content of the first found data file in the zip archive's root will be returned.
- Return values
-
false|string | the data file content as string; false, if file cannot be found/read |
◆ get_file_content_from_zip()
mod_data\local\importer\entries_importer::get_file_content_from_zip |
( |
string | $filename, |
|
|
string | $zipsubdir = 'files/' ) |
Returns the file content from a file which has been stored in the zip archive.
- Parameters
-
string | $filename | |
string | $zipsubdir | |
- Return values
-
false|string | the file content as string, false if the file could not be found/read |
◆ get_import_data_file_extension()
mod_data\local\importer\entries_importer::get_import_data_file_extension |
( |
| ) |
|
|
abstract |
Return the file extension of the import data file which is being used, for example 'csv' for a csv entries_importer.
- Return values
-
string | the file extension of the export data file |
Reimplemented in mod_data\local\importer\csv_entries_importer.
The documentation for this class was generated from the following file:
- mod/data/classes/local/importer/entries_importer.php