original_string: public function get_next_stage() {
          if ($this->oneclickbackup) {
              // Its a one click backup.
              // The default filename is backup.mbz, this normally gets set to something useful in the confirmation stage.
              // because we skipped that stage we must manually set this to a useful value.
              $tasks = $this->ui->get_tasks();
              foreach ($tasks as $task) {
                  if ($task instanceof backup_root_task) {
                      // Find the filename setting.
                      $setting = $task->get_setting('filename');
                      if ($setting) {
                          // Use the helper objects to get a useful name.
                          $filename = backup_plan_dbops::get_default_backup_filename(
                              $this->ui->get_format(),
                              $this->ui->get_type(),
                              $this->ui->get_controller_id(),
                              $this->ui->get_setting_value('users'),
                              $this->ui->get_setting_value('anonymize')
                          );
                          $setting->set_value($filename);
                      }
                  }
              }
              return backup_ui::STAGE_FINAL;
          }
          return parent::get_next_stage();
      }
code: public function get_next_stage() {
          if ($this->oneclickbackup) {
              // Its a one click backup.
              // The default filename is backup.mbz, this normally gets set to something useful in the confirmation stage.
              // because we skipped that stage we must manually set this to a useful value.
              $tasks = $this->ui->get_tasks();
              foreach ($tasks as $task) {
                  if ($task instanceof backup_root_task) {
                      // Find the filename setting.
                      $setting = $task->get_setting('filename');
                      if ($setting) {
                          // Use the helper objects to get a useful name.
                          $filename = backup_plan_dbops::get_default_backup_filename(
                              $this->ui->get_format(),
                              $this->ui->get_type(),
                              $this->ui->get_controller_id(),
                              $this->ui->get_setting_value('users'),
                              $this->ui->get_setting_value('anonymize')
                          );
                          $setting->set_value($filename);
                      }
                  }
              }
              return backup_ui::STAGE_FINAL;
          }
          return parent::get_next_stage();
      }
code_tokens: public function get_next_stage ( ) { if ( $ this -> oneclickbackup ) { // Its a one click backup. // The default filename is backup.mbz, this normally gets set to something useful in the confirmation stage. // because we skipped that stage we must manually set this to a useful value. $ tasks = $ this -> ui -> get_tasks ( ) ; foreach ( $ tasks as $ task ) { if ( $ task instanceof backup_root_task ) { // Find the filename setting. $ setting = $ task -> get_setting ( 'filename' ) ; if ( $ setting ) { // Use the helper objects to get a useful name. $ filename = backup_plan_dbops :: get_default_backup_filename ( $ this -> ui -> get_format ( ) , $ this -> ui -> get_type ( ) , $ this -> ui -> get_controller_id ( ) , $ this -> ui -> get_setting_value ( 'users' ) , $ this -> ui -> get_setting_value ( 'anonymize' ) ) ; $ setting -> set_value ( $ filename ) ; } } } return backup_ui :: STAGE_FINAL ; } return parent :: get_next_stage ( ) ; }
docstring: Gets the next stage for the backup.
  
  We override this function to implement the one click backup.
  When the user performs a one click backup we jump straight to the final stage.
  
  @return int
docstring_tokens: Gets the next stage for the backup .