Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 402] [Versions 400 and 403]

Defines restore_activity_task class

Copyright: 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 361 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: restore_activity_task  - X-Ref

abstract activity task that provides all the properties and common tasks to be performed
when one activity is being restored

TODO: Finish phpdocs
__construct($name, $info, $plan = null)   X-Ref
Constructor - instantiates one object of this class


get_taskbasepath()   X-Ref
Activity tasks have their own directory to read files


set_moduleid($moduleid)   X-Ref
No description

set_old_moduleversion($oldmoduleversion)   X-Ref
No description

set_activityid($activityid)   X-Ref
No description

set_old_activityid($activityid)   X-Ref
No description

set_contextid($contextid)   X-Ref
No description

set_old_contextid($contextid)   X-Ref
No description

get_modulename()   X-Ref
No description

get_moduleid()   X-Ref
No description

get_old_moduleid()   X-Ref
Returns the old course module id (cmid of activity which will be restored)

return: int

get_old_moduleversion()   X-Ref
No description

get_activityid()   X-Ref
No description

get_old_activityid()   X-Ref
No description

get_contextid()   X-Ref
No description

get_old_contextid()   X-Ref
No description

build()   X-Ref
Create all the steps that will be part of this task


execute()   X-Ref
Exceptionally override the execute method, so, based in the activity_included setting, we are able
to skip the execution of one task completely


get_setting($name)   X-Ref
Specialisation that, first of all, looks for the setting within
the task with the the prefix added and later, delegates to parent
without adding anything


define_decode_contents()   X-Ref
Define the contents in the activity that must be
processed by the link decoder


define_decode_rules()   X-Ref
Define the decoding rules for links belonging
to the activity to be executed by the link decoder


define_restore_log_rules()   X-Ref
Define the restore log rules that will be applied
by the {@link restore_logs_processor} when restoring
activity logs. It must return one array
of {@link restore_log_rule} objects


define_settings()   X-Ref
Define the common setting that any restore activity will have