public function add_dependency(backup_setting $dependentsetting, $type = setting_dependency::DISABLED_VALUE, $options = array()) { // Check the dependency level is >= current level if ($dependentsetting->get_level() < $this->level) { throw new backup_setting_exception('cannot_add_upper_level_dependency'); } parent::add_dependency($dependentsetting, $type, $options); }
/** * {@inheritdoc} */ public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) { $this->level = self::ROOT_LEVEL; parent::__construct($name, $vtype, $value, $visibility, $status); }
/** * Gets the the PARAM_XXXX validation to be applied to the setting * * return string The PARAM_XXXX constant of null if the setting type is not defined */ public function get_param_validation() { return $this->setting->get_param_validation(); }
/** * Adds dependencies to the form recursively * * @param backup_setting $setting */ public function add_dependencies(backup_setting $setting) { $mform = $this->_form; // Apply all dependencies for backup. foreach ($setting->get_my_dependency_properties() as $key => $dependency) { call_user_func_array(array($this->_form, 'disabledIf'), $dependency); } }
/** * Gets the value to display in a static quickforms element * @return mixed */ public function get_static_value() { return $this->setting->get_value(); }