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 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

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: 371 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


get_comment_mapping_itemname($commentarea)   X-Ref
Given a commment area, return the itemname that contains the itemid mappings

By default both are the same (commentarea = itemname), so return it. If some
module uses a different approach, this method can be overriden in its taks

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