Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core\moodlenet\activity_packager Class Reference

Public Member Functions

 __construct (protected cm_info $cminfo, protected int $userid,)
 Constructor.
 
 __destruct ()
 Destructor.
 
 get_package ()
 Prepare the backup file using appropriate setting overrides and return relevant information.
 

Protected Member Functions

 get_all_task_settings ()
 Get all backup settings available for override.
 
 override_task_setting (array $alltasksettings, string $settingname, int $settingvalue)
 Override a backup task setting with a given value.
 
 package ()
 Package the activity identified by CMID into a new stored_file.
 

Protected Attributes

backup_controller $controller
 $controller
 

Constructor & Destructor Documentation

◆ __construct()

core\moodlenet\activity_packager::__construct ( protected cm_info $cminfo,
protected int $userid )

Constructor.

Parameters
cm_info$cminfocontext module information about the resource being packaged.
int$useridThe ID of the user performing the packaging.

Member Function Documentation

◆ get_all_task_settings()

core\moodlenet\activity_packager::get_all_task_settings ( )
protected

Get all backup settings available for override.

Return values
arraythe associative array of taskclass => settings instances.

◆ get_package()

core\moodlenet\activity_packager::get_package ( )

Prepare the backup file using appropriate setting overrides and return relevant information.

Return values
stored_file

◆ override_task_setting()

core\moodlenet\activity_packager::override_task_setting ( array $alltasksettings,
string $settingname,
int $settingvalue )
protected

Override a backup task setting with a given value.

Parameters
array$alltasksettingsAll task settings.
string$settingnameThe name of the setting to be overridden (task class name format).
int$settingvalueValue to be given to the setting.

◆ package()

core\moodlenet\activity_packager::package ( )
protected

Package the activity identified by CMID into a new stored_file.

Return values
stored_file
Exceptions
moodle_exception

The documentation for this class was generated from the following file: