original_string: public function define_course_plugin_structure() {
          global $DB;
  
          // Since this method is executed before the restore we can do some pre-checks here.
          // In case of merging backup into existing course find the current number of sections.
          $target = $this->step->get_task()->get_target();
          if (($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_ADDING) &&
                  $this->is_pre_33_backup()) {
              $maxsection = $DB->get_field_sql(
                  'SELECT max(section) FROM {course_sections} WHERE course = ?',
                  [$this->step->get_task()->get_courseid()]);
              $this->originalnumsections = (int)$maxsection;
          }
  
          // Dummy path element is needed in order for after_restore_course() to be called.
          return [new restore_path_element('dummy_course', $this->get_pathfor('/dummycourse'))];
      }
code: public function define_course_plugin_structure() {
          global $DB;
  
          // Since this method is executed before the restore we can do some pre-checks here.
          // In case of merging backup into existing course find the current number of sections.
          $target = $this->step->get_task()->get_target();
          if (($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_ADDING) &&
                  $this->is_pre_33_backup()) {
              $maxsection = $DB->get_field_sql(
                  'SELECT max(section) FROM {course_sections} WHERE course = ?',
                  [$this->step->get_task()->get_courseid()]);
              $this->originalnumsections = (int)$maxsection;
          }
  
          // Dummy path element is needed in order for after_restore_course() to be called.
          return [new restore_path_element('dummy_course', $this->get_pathfor('/dummycourse'))];
      }
code_tokens: public function define_course_plugin_structure ( ) { global $ DB ; // Since this method is executed before the restore we can do some pre-checks here. // In case of merging backup into existing course find the current number of sections. $ target = $ this -> step -> get_task ( ) -> get_target ( ) ; if ( ( $ target == backup :: TARGET_CURRENT_ADDING || $ target == backup :: TARGET_EXISTING_ADDING ) && $ this -> is_pre_33_backup ( ) ) { $ maxsection = $ DB -> get_field_sql ( 'SELECT max(section) FROM {course_sections} WHERE course = ?' , [ $ this -> step -> get_task ( ) -> get_courseid ( ) ] ) ; $ this -> originalnumsections = ( int ) $ maxsection ; } // Dummy path element is needed in order for after_restore_course() to be called. return [ new restore_path_element ( 'dummy_course' , $ this -> get_pathfor ( '/dummycourse' ) ) ] ; }
docstring: Creates a dummy path element in order to be able to execute code after restore
  
  @return restore_path_element[]
docstring_tokens: Creates a dummy path element in order to be able to execute code after restore