Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
This abstract class defines one basic setting. More...
Public Member Functions | |
__construct ($name, $vtype, $value=null, $visibility=self::VISIBLE, $status=self::NOT_LOCKED) | |
Instantiates a setting object. More... | |
add_dependency (base_setting $dependentsetting, $type=null, $options=array()) | |
Quick method to add a dependency to this setting. More... | |
destroy () | |
Destroy all circular references. More... | |
get_dependencies () | |
get_help () | |
Gets the help string params for this setting if it has been set. More... | |
get_my_dependency_properties ($settingname=null) | |
Gets an array of properties for all of the dependencies that will affect this setting. More... | |
get_name () | |
get_param_validation () | |
Get the PARAM_XXXX validation to be applied to the setting. More... | |
get_settings_depended_on () | |
Returns all of the dependencies that affect this setting. More... | |
get_status () | |
get_ui () | |
Gets the user interface for this setting. More... | |
get_ui_name () | |
get_ui_type () | |
get_value () | |
get_visibility () | |
has_dependencies_on_settings () | |
Checks if this setting is dependent on any other settings. More... | |
has_dependent_settings () | |
Checks if there are other settings that are dependent on this setting. More... | |
has_help () | |
Returns true if help has been set for this setting. More... | |
register_dependency (setting_dependency $dependency) | |
Adds a dependency where another setting depends on this setting. More... | |
set_help ($identifier, $component='moodle') | |
Sets a help string for this setting. More... | |
set_status ($status) | |
set_ui (backup_setting_ui $ui) | |
Sets the user interface for this setting. More... | |
set_value ($value) | |
set_visibility ($visibility) | |
Protected Member Functions | |
inform_dependencies ($ctype, $oldv) | |
is_circular_reference ($obj) | |
register_dependent_dependency (setting_dependency $dependency) | |
Adds a dependency where this setting is dependent on another. More... | |
validate_status ($status) | |
validate_value ($vtype, $value) | |
validate_visibility ($visibility) | |
Protected Attributes | |
setting_dependency[] | $dependencies = array() |
$dependenton = array() | |
array | $help = array() |
An array that contains the identifier and component of a help string if one has been set. | |
$name | |
$status | |
backup_setting_ui backup_setting_ui_checkbox backup_setting_ui_radio backup_setting_ui_select backup_setting_ui_text | $uisetting |
The user interface for this setting. | |
$unlockedvalue | |
$value | |
$visibility | |
$vtype | |
This abstract class defines one basic setting.
Each setting will be able to control its name, value (from a list), ui representation (check box, drop down, text field...), visibility, status (editable/locked...) and its hierarchy with other settings (using one like-observer pattern.
TODO: Finish phpdocs
base_setting::__construct | ( | $name, | |
$vtype, | |||
$value = null , |
|||
$visibility = self::VISIBLE , |
|||
$status = self::NOT_LOCKED |
|||
) |
Instantiates a setting object.
string | $name | Name of the setting |
string | $vtype | Type of the setting, eg self::IS_TEXT |
mixed | $value | Value of the setting |
bool | $visibility | Is the setting visible in the UI, eg } * int $status Status of the setting with regards to the locking, eg self::NOT_LOCKED |
Reimplemented in section_backup_setting, root_backup_setting, course_backup_setting, backup_setting, activity_backup_setting, restore_course_generic_text_setting, and backup_filename_setting.
base_setting::add_dependency | ( | base_setting | $dependentsetting, |
$type = null , |
|||
$options = array() |
|||
) |
Quick method to add a dependency to this setting.
The dependency created is done so by inspecting this setting and the setting that is passed in as the dependent setting.
base_setting | $dependentsetting | |
int | $type | One of setting_dependency::* |
array | $options |
Reimplemented in backup_setting.
base_setting::destroy | ( | ) |
Destroy all circular references.
It helps PHP 5.2 a lot!
base_setting::get_help | ( | ) |
Gets the help string params for this setting if it has been set.
array|false | An array (identifier, component) or false if not set |
base_setting::get_my_dependency_properties | ( | $settingname = null | ) |
Gets an array of properties for all of the dependencies that will affect this setting.
This method returns an array rather than the dependencies in order to minimise the memory footprint of for the potentially huge recursive dependency structure that we may be dealing with.
This method also ensures that all dependencies are transmuted to affect the setting in question and that we don't provide any duplicates.
string | null | $settingname |
array |
base_setting::get_param_validation | ( | ) |
Get the PARAM_XXXX validation to be applied to the setting.
string | The PARAM_XXXX constant of null if the setting type is not defined |
base_setting::get_settings_depended_on | ( | ) |
Returns all of the dependencies that affect this setting.
e.g. settings this setting depends on.
array | Array of setting_dependency's |
base_setting::get_ui | ( | ) |
Gets the user interface for this setting.
base_setting_ui |
base_setting::has_dependencies_on_settings | ( | ) |
Checks if this setting is dependent on any other settings.
bool | True if this setting is dependent on any other settings |
base_setting::has_dependent_settings | ( | ) |
Checks if there are other settings that are dependent on this setting.
bool | True if there are other settings that are dependent on this setting |
base_setting::has_help | ( | ) |
Returns true if help has been set for this setting.
cool |
base_setting::register_dependency | ( | setting_dependency | $dependency | ) |
Adds a dependency where another setting depends on this setting.
setting_dependency | $dependency |
|
protected |
Adds a dependency where this setting is dependent on another.
This should only be called internally once we are sure it is not cicrular.
setting_dependency | $dependency |
base_setting::set_help | ( | $identifier, | |
$component = 'moodle' |
|||
) |
Sets a help string for this setting.
string | $identifier | |
string | $component |
base_setting::set_ui | ( | backup_setting_ui | $ui | ) |
Sets the user interface for this setting.
base_setting_ui | $ui |