Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
backup_plan Class Reference

Implementable class defining the needed stuf for one backup plan. More...

Inheritance diagram for backup_plan:
base_plan loggable checksumable executable

Public Member Functions

 __construct ($controller)
 Constructor - instantiates one object of this class.
 
 add_result ($result)
 Add the passed info to the plan results.
 
 add_task ($task)
 
 build ()
 Function responsible for building the tasks of any plan with their corresponding settings (must set the $built property to true)
 
 calculate_checksum ()
 This function will return one unique and stable checksum for one instance of the class implementing it.
 
 debug_display_all_settings_values ()
 For debug only.
 
 destroy ()
 Destroy all circular references.
 
 execute ()
 Function responsible for executing the tasks of any plan.
 
 get_backupid ()
 
 get_basepath ()
 
 get_courseid ()
 
 get_kept_roles ()
 Get the user roles that should be kept in the destination course for a course copy operation.
 
 get_logger ()
 
 get_mode ()
 
 get_name ()
 
 get_progress ()
 Gets the progress reporter, which can be used to report progress within the backup or restore process.
 
 get_results ()
 Return the results collected via self::add_result() method.
 
 get_setting ($name)
 return one setting by name, useful to request root/course settings that are, by definition, unique by name.
 
 get_settings ()
 
 get_tasks ()
 
 get_type ()
 
 is_checksum_correct ($checksum)
 Given one checksum, returns if matches object's checksum (true) or no (false)
 
 is_excluding_activities ()
 
 log ($message, $level, $a=null, $depth=null, $display=false)
 This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed.
 
 set_excluding_activities ()
 
 set_kept_roles (array $roleids)
 Sets the user roles that should be kept in the destination course for a course copy operation.
 
 setting_exists ($name)
 Wrapper over @get_setting() that returns if the requested setting exists or no.
 

Protected Attributes

 $basepath
 
 $built
 
 $controller
 
 $excludingdactivities
 
array $keptroles = array()
 The role ids to keep in a copy operation.
 
 $name
 
 $results
 
 $settings
 
 $tasks
 

Detailed Description

Implementable class defining the needed stuf for one backup plan.

TODO: Finish phpdocs

Constructor & Destructor Documentation

◆ __construct()

backup_plan::__construct ( $controller)

Constructor - instantiates one object of this class.

Reimplemented from base_plan.

Member Function Documentation

◆ add_result()

base_plan::add_result ( $result)
inherited

Add the passed info to the plan results.

At the moment we expect an associative array structure to be merged into the current results. In the future, some sort of base_result class may be introduced.

Parameters
array$resultassociative array describing a result of a task/step

◆ build()

backup_plan::build ( )

Function responsible for building the tasks of any plan with their corresponding settings (must set the $built property to true)

Reimplemented from base_plan.

◆ calculate_checksum()

base_plan::calculate_checksum ( )
inherited

This function will return one unique and stable checksum for one instance of the class implementing it.

It's each implementation responsibility to do it recursively if needed and use optional store (caching) of the checksum if necessary/possible

Implements checksumable.

◆ debug_display_all_settings_values()

base_plan::debug_display_all_settings_values ( )
inherited

For debug only.

Get a simple test display of all the settings.

Return values
string

◆ destroy()

backup_plan::destroy ( )

Destroy all circular references.

It helps PHP 5.2 a lot!

Reimplemented from base_plan.

◆ execute()

backup_plan::execute ( )

Function responsible for executing the tasks of any plan.

Reimplemented from base_plan.

◆ get_kept_roles()

backup_plan::get_kept_roles ( )

Get the user roles that should be kept in the destination course for a course copy operation.

Return values
array

◆ get_progress()

backup_plan::get_progress ( )

Gets the progress reporter, which can be used to report progress within the backup or restore process.

Return values
core\progress\baseProgress reporting object

Reimplemented from base_plan.

◆ get_results()

base_plan::get_results ( )
inherited

Return the results collected via self::add_result() method.

Return values
array

◆ get_setting()

base_plan::get_setting ( $name)
inherited

return one setting by name, useful to request root/course settings that are, by definition, unique by name.

Parameters
string$namename of the setting
Return values
base_setting
Exceptions
base_plan_exceptionif setting name is not found.

◆ is_checksum_correct()

base_plan::is_checksum_correct ( $checksum)
inherited

Given one checksum, returns if matches object's checksum (true) or no (false)

Implements checksumable.

◆ log()

backup_plan::log ( $message,
$level,
$a = null,
$depth = null,
$display = false )

This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed.

Implements loggable.

◆ set_kept_roles()

backup_plan::set_kept_roles ( array $roleids)

Sets the user roles that should be kept in the destination course for a course copy operation.

Parameters
array$roleids

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