Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
data_preset_importer Class Reference

Abstract class used for data preset importers. More...

Inheritance diagram for data_preset_importer:
data_preset_existing_importer data_preset_upload_importer

Public Member Functions

 __construct ($course, $cm, $module, $directory)
 Constructor.
 
 cleanup ()
 Any clean up routines should go here.
 
 data_preset_get_file_contents (&$filestorage, &$fileobj, $dir, $filename)
 Retreive the contents of a file.
 
 get_directory ()
 Returns the name of the directory the preset is located in.
 
moodle_database get_preset_settings ()
 Gets the preset settings $DB.
 
 import ($overwritesettings)
 Import the preset into the given database module.
 

Protected Attributes

 $cm
 
 $course
 
 $directory
 
 $module
 

Detailed Description

Abstract class used for data preset importers.

Deprecated
since Moodle 4.1 MDL-75140 - please do not use this class any more.
Todo
MDL-75189 Final deprecation in Moodle 4.5.

Constructor & Destructor Documentation

◆ __construct()

data_preset_importer::__construct ( $course,
$cm,
$module,
$directory )

Constructor.

Parameters
stdClass$course
stdClass$cm
stdClass$module
string$directory

Reimplemented in data_preset_existing_importer, and data_preset_upload_importer.

Member Function Documentation

◆ cleanup()

data_preset_importer::cleanup ( )

Any clean up routines should go here.

Return values
bool

Reimplemented in data_preset_upload_importer.

◆ data_preset_get_file_contents()

data_preset_importer::data_preset_get_file_contents ( & $filestorage,
& $fileobj,
$dir,
$filename )

Retreive the contents of a file.

That file may either be in a conventional directory of the Moodle file storage

Parameters
file_storage$filestorage,.should be null if using a conventional directory
stored_file$fileobjthe directory to look in. null if using a conventional directory
string$dirthe directory to look in. null if using the Moodle file storage
string$filenamethe name of the file we want
Return values
stringthe contents of the file or null if the file doesn't exist.

◆ get_directory()

data_preset_importer::get_directory ( )

Returns the name of the directory the preset is located in.

Return values
string

◆ get_preset_settings()

moodle_database data_preset_importer::get_preset_settings ( )

Gets the preset settings $DB.

Return values
stdClass

◆ import()

data_preset_importer::import ( $overwritesettings)

Import the preset into the given database module.

Return values
bool

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