Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 402 and 403]

(no description)

File Size: 172 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

activity_packager:: (6 methods):
  __construct()
  __destruct()
  get_package()
  get_all_task_settings()
  override_task_setting()
  package()


Class: activity_packager  - X-Ref

Packager to prepare appropriate backup of an activity to share to MoodleNet.

__construct(protected cm_info $cminfo,protected int $userid,)   X-Ref
Constructor.

param: cm_info $cminfo context module information about the resource being packaged.
param: int $userid The ID of the user performing the packaging.

__destruct()   X-Ref
Destructor


get_package()   X-Ref
Prepare the backup file using appropriate setting overrides and return relevant information.

return: stored_file

get_all_task_settings()   X-Ref
Get all backup settings available for override.

return: array the associative array of taskclass => settings instances.

override_task_setting(array $alltasksettings, string $settingname, int $settingvalue)   X-Ref
Override a backup task setting with a given value.

param: array $alltasksettings All task settings.
param: string $settingname The name of the setting to be overridden (task class name format).
param: int $settingvalue Value to be given to the setting.

package()   X-Ref
Package the activity identified by CMID into a new stored_file.

return: stored_file