original_string: protected function process_value_change($oldvalue) {
          if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_PERMISSION ||
                  $this->dependentsetting->get_status() == base_setting::LOCKED_BY_CONFIG) {
              // When setting is locked by permission or config do not apply dependencies.
              return false;
          }
          $prevalue = $this->dependentsetting->get_value();
          // If the setting is the desired value enact the dependency.
          $settingvalue = $this->setting->get_value();
          if ($this->evaluate_disabled_condition($settingvalue)) {
              // The dependent setting needs to be locked by hierachy and set to the
              // default value.
              $this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
  
              // For checkboxes the default value is false, but when the setting is
              // locked, the value should inherit from the parent setting.
              if ($this->defaultvalue === false) {
                  $this->dependentsetting->set_value($settingvalue);
              } else {
                  $this->dependentsetting->set_value($this->defaultvalue);
              }
          } else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
              // We can unlock the dependent setting.
              $this->dependentsetting->set_status(base_setting::NOT_LOCKED);
          }
          // Return true if the value has changed for the dependent setting.
          return ($prevalue != $this->dependentsetting->get_value());
      }
code: protected function process_value_change($oldvalue) {
          if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_PERMISSION ||
                  $this->dependentsetting->get_status() == base_setting::LOCKED_BY_CONFIG) {
              // When setting is locked by permission or config do not apply dependencies.
              return false;
          }
          $prevalue = $this->dependentsetting->get_value();
          // If the setting is the desired value enact the dependency.
          $settingvalue = $this->setting->get_value();
          if ($this->evaluate_disabled_condition($settingvalue)) {
              // The dependent setting needs to be locked by hierachy and set to the
              // default value.
              $this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
  
              // For checkboxes the default value is false, but when the setting is
              // locked, the value should inherit from the parent setting.
              if ($this->defaultvalue === false) {
                  $this->dependentsetting->set_value($settingvalue);
              } else {
                  $this->dependentsetting->set_value($this->defaultvalue);
              }
          } else if ($this->dependentsetting->get_status() == base_setting::LOCKED_BY_HIERARCHY) {
              // We can unlock the dependent setting.
              $this->dependentsetting->set_status(base_setting::NOT_LOCKED);
          }
          // Return true if the value has changed for the dependent setting.
          return ($prevalue != $this->dependentsetting->get_value());
      }
code_tokens: protected function process_value_change ( $ oldvalue ) { if ( $ this -> dependentsetting -> get_status ( ) == base_setting :: LOCKED_BY_PERMISSION || $ this -> dependentsetting -> get_status ( ) == base_setting :: LOCKED_BY_CONFIG ) { // When setting is locked by permission or config do not apply dependencies. return false ; } $ prevalue = $ this -> dependentsetting -> get_value ( ) ; // If the setting is the desired value enact the dependency. $ settingvalue = $ this -> setting -> get_value ( ) ; if ( $ this -> evaluate_disabled_condition ( $ settingvalue ) ) { // The dependent setting needs to be locked by hierachy and set to the // default value. $ this -> dependentsetting -> set_status ( base_setting :: LOCKED_BY_HIERARCHY ) ; // For checkboxes the default value is false, but when the setting is // locked, the value should inherit from the parent setting. if ( $ this -> defaultvalue === false ) { $ this -> dependentsetting -> set_value ( $ settingvalue ) ; } else { $ this -> dependentsetting -> set_value ( $ this -> defaultvalue ) ; } } else if ( $ this -> dependentsetting -> get_status ( ) == base_setting :: LOCKED_BY_HIERARCHY ) { // We can unlock the dependent setting. $ this -> dependentsetting -> set_status ( base_setting :: NOT_LOCKED ) ; } // Return true if the value has changed for the dependent setting. return ( $ prevalue != $ this -> dependentsetting -> get_value ( ) ) ; }
docstring: Processes a value change in the primary setting
  @param mixed $oldvalue
  @return bool
docstring_tokens: Processes a value change in the primary setting