Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
tool_moodlenet\local\import_processor Class Reference

The import_processor class. More...

Public Member Functions

 __construct (\stdClass $course, int $section, remote_resource $remoteresource, import_handler_info $handlerinfo, import_handler_registry $handlerregistry)
 The import_processor constructor.
 
 process ()
 Run the import process, including file download, module creation and cleanup (cache purge, etc).
 

Protected Member Functions

 create_course_module (\stdClass $course, int $section, string $modname)
 Create the course module to hold the file/content that has been uploaded.
 
 finish_setup_course_module ($instanceid, int $cmid)
 Finish off any course module setup, such as adding to the course section and firing events.
 
 update_module_description (int $instanceid)
 Update the module's description (intro), if that feature is supported.
 

Protected Attributes

object $course = null
 The course that we are uploading to.
 
string[] $descriptionoverrides = ['folder', 'page', 'resource', 'scorm', 'url']
 $descriptionoverrides list of modules which support having their descriptions updated, post-import.
 
import_handler_info $handlerinfo
 $handlerinfo information about the module handling the import.
 
import_handler_registry $handlerregistry
 $handlerregistry registry object to use for cross checking the supplied handler.
 
remote_resource $remoteresource
 $remoteresource the remote resource being imported.
 
int $section = null
 The section number we are uploading to.
 
stdClass $user
 $user the user conducting the import.
 

Detailed Description

The import_processor class.

The import_processor objects provide a means to import a remote resource into a course section, delegating the handling of content to the relevant module, via its dndupload_handler callback.

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

Constructor & Destructor Documentation

◆ __construct()

tool_moodlenet\local\import_processor::__construct ( \stdClass $course,
int $section,
remote_resource $remoteresource,
import_handler_info $handlerinfo,
import_handler_registry $handlerregistry )

The import_processor constructor.

Parameters
stdClass$coursethe course object.
int$sectionthe section number in the course, starting at 0.
remote_resource$remoteresourcethe remote resource to import.
import_handler_info$handlerinfoinformation about which module is handling the import.
import_handler_registry$handlerregistryA registry of import handlers, to use for validation.
Exceptions
coding_exceptionIf any of the params are invalid.

Member Function Documentation

◆ create_course_module()

tool_moodlenet\local\import_processor::create_course_module ( \stdClass $course,
int $section,
string $modname )
protected

Create the course module to hold the file/content that has been uploaded.

Parameters
stdClass$coursethe course object.
int$sectionthe section.
string$modnamethe name of the module, e.g. 'label'.
Return values
stdClassthe course module data.

◆ finish_setup_course_module()

tool_moodlenet\local\import_processor::finish_setup_course_module ( $instanceid,
int $cmid )
protected

Finish off any course module setup, such as adding to the course section and firing events.

Parameters
int$instanceidid returned by the mod when it was created.
int$cmidthe course module record id, for removal if something went wrong.

◆ update_module_description()

tool_moodlenet\local\import_processor::update_module_description ( int $instanceid)
protected

Update the module's description (intro), if that feature is supported.

Parameters
int$instanceidthe instance id of the module to update.

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