Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Contains the import_info class.

Copyright: 2020 Jake Dallimore <jrhdallimore@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 126 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

import_info:: (8 methods):
  __construct()
  get_id()
  get_resource()
  get_config()
  set_config()
  load()
  save()
  purge()


Class: import_info  - X-Ref

Class import_info, describing objects which represent a resource being imported by a user.

Objects of this class encapsulate both:
- information about the resource (remote_resource).
- config data pertaining to the import process, such as the destination course and section
and how the resource should be treated (i.e. the type and the name of the module selected as the import handler)

__construct(int $userid, remote_resource $resource, \stdClass $config)   X-Ref
The import_controller constructor.

param: int $userid the id of the user performing the import.
param: remote_resource $resource the resource being imported.
param: \stdClass $config import config like 'course', 'section', 'type'.

get_id()   X-Ref
Get the id of this object.


get_resource()   X-Ref
Get the remote resource being imported.

return: remote_resource the remote resource being imported.

get_config()   X-Ref
Get the configuration data pertaining to the import.

return: \stdClass the import configuration data.

set_config(\stdClass $config)   X-Ref
Set the configuration data pertaining to the import.

param: \stdClass $config the configuration data to set.

load(string $id)   X-Ref
Get an import_info object by id.

param: string $id the id of the import_info object to load.
return: mixed an import_info object if found, otherwise null.

save()   X-Ref
Save this object to a store which is accessible across requests.


purge()   X-Ref
Remove all information about an import from the store.