Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

File containing processor class.

Copyright: 2013 Frédéric Massart
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 390 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

tool_uploadcourse_processor:: (10 methods):
  __construct()
  execute()
  get_course()
  get_errors()
  get_restore_content_dir()
  log_error()
  parse_line()
  preview()
  reset()
  validate()


Class: tool_uploadcourse_processor  - X-Ref

Processor class.

__construct(csv_import_reader $cir, array $options, array $defaults = array()   X-Ref
Constructor

param: csv_import_reader $cir import reader object
param: array $options options of the process
param: array $defaults default data value

execute($tracker = null)   X-Ref
Execute the process.

param: object $tracker the output tracker to use.
return: void

get_course($data)   X-Ref
Return a course import object.

param: array $data data to import the course with.
return: tool_uploadcourse_course

get_errors()   X-Ref
Return the errors.

return: array

get_restore_content_dir()   X-Ref
Get the directory of the object to restore.

return: string subdirectory in $CFG->backuptempdir/...

log_error($errors)   X-Ref
Log errors on the current line.

param: array $errors array of errors
return: void

parse_line($line)   X-Ref
Parse a line to return an array(column => value)

param: array $line returned by csv_import_reader
return: array

preview($rows = 10, $tracker = null)   X-Ref
Return a preview of the import.

This only returns passed data, along with the errors.

param: integer $rows number of rows to preview.
param: object $tracker the output tracker to use.
return: array of preview data.

reset()   X-Ref
Reset the current process.

return: void.

validate()   X-Ref
Validation.

return: void