Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Abstract class defining the basis for one execution (backup/restore) plan. More...
Public Member Functions | |
__construct ($name) | |
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_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 () | |
is_checksum_correct ($checksum) | |
Given one checksum, returns if matches object's checksum (true) or no (false) | |
setting_exists ($name) | |
Wrapper over @get_setting() that returns if the requested setting exists or no. | |
Protected Attributes | |
$built | |
$name | |
$results | |
$settings | |
$tasks | |
Abstract class defining the basis for one execution (backup/restore) plan.
TODO: Finish phpdocs
base_plan::__construct | ( | $name | ) |
Constructor - instantiates one object of this class.
Reimplemented in backup_plan, and restore_plan.
base_plan::add_result | ( | $result | ) |
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.
array | $result | associative array describing a result of a task/step |
|
abstract |
Function responsible for building the tasks of any plan with their corresponding settings (must set the $built property to true)
Reimplemented in backup_plan, and restore_plan.
base_plan::calculate_checksum | ( | ) |
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.
base_plan::debug_display_all_settings_values | ( | ) |
For debug only.
Get a simple test display of all the settings.
string |
base_plan::destroy | ( | ) |
Destroy all circular references.
It helps PHP 5.2 a lot!
Reimplemented in backup_plan, and restore_plan.
base_plan::execute | ( | ) |
Function responsible for executing the tasks of any plan.
Implements executable.
Reimplemented in backup_plan, and restore_plan.
|
abstract |
Gets the progress reporter, which can be used to report progress within the backup or restore process.
core\progress\base | Progress reporting object |
Reimplemented in backup_plan, and restore_plan.
base_plan::get_results | ( | ) |
Return the results collected via self::add_result() method.
array |
base_plan::get_setting | ( | $name | ) |
return one setting by name, useful to request root/course settings that are, by definition, unique by name.
string | $name | name of the setting |
base_setting |
base_plan_exception | if setting name is not found. |
base_plan::is_checksum_correct | ( | $checksum | ) |
Given one checksum, returns if matches object's checksum (true) or no (false)
Implements checksumable.