original_string: public function get_status() {
          if ($this->combinedfile) {
              // The combined file exists. Report success.
              return self::STATUS_COMPLETE;
          }
  
          if (empty($this->sourcefiles)) {
              // There are no source files to combine.
              return self::STATUS_FAILED;
          }
  
          if (!empty($this->combinationstatus)) {
              // The combination is in progress and has set a status.
              // Return it instead.
              return $this->combinationstatus;
          }
  
          $pending = false;
          $partial = false;
          foreach ($this->sourcefiles as $file) {
              // The combined file has not yet been generated.
              // Check the status of each source file.
              if (is_a($file, \core_files\conversion::class)) {
                  $status = $file->get('status');
                  switch ($status) {
                      case \core_files\conversion::STATUS_IN_PROGRESS:
                      case \core_files\conversion::STATUS_PENDING:
                          $pending = true;
                          break;
  
                      // There are 4 status flags, so the only remaining one is complete which is fine.
                      case \core_files\conversion::STATUS_FAILED:
                          $partial = true;
                          break;
                  }
              }
          }
          if ($pending) {
              return self::STATUS_PENDING_INPUT;
          } else {
              if ($partial) {
                  return self::STATUS_READY_PARTIAL;
              }
              return self::STATUS_READY;
          }
      }
code: public function get_status() {
          if ($this->combinedfile) {
              // The combined file exists. Report success.
              return self::STATUS_COMPLETE;
          }
  
          if (empty($this->sourcefiles)) {
              // There are no source files to combine.
              return self::STATUS_FAILED;
          }
  
          if (!empty($this->combinationstatus)) {
              // The combination is in progress and has set a status.
              // Return it instead.
              return $this->combinationstatus;
          }
  
          $pending = false;
          $partial = false;
          foreach ($this->sourcefiles as $file) {
              // The combined file has not yet been generated.
              // Check the status of each source file.
              if (is_a($file, \core_files\conversion::class)) {
                  $status = $file->get('status');
                  switch ($status) {
                      case \core_files\conversion::STATUS_IN_PROGRESS:
                      case \core_files\conversion::STATUS_PENDING:
                          $pending = true;
                          break;
  
                      // There are 4 status flags, so the only remaining one is complete which is fine.
                      case \core_files\conversion::STATUS_FAILED:
                          $partial = true;
                          break;
                  }
              }
          }
          if ($pending) {
              return self::STATUS_PENDING_INPUT;
          } else {
              if ($partial) {
                  return self::STATUS_READY_PARTIAL;
              }
              return self::STATUS_READY;
          }
      }
code_tokens: public function get_status ( ) { if ( $ this -> combinedfile ) { // The combined file exists. Report success. return self :: STATUS_COMPLETE ; } if ( empty ( $ this -> sourcefiles ) ) { // There are no source files to combine. return self :: STATUS_FAILED ; } if ( ! empty ( $ this -> combinationstatus ) ) { // The combination is in progress and has set a status. // Return it instead. return $ this -> combinationstatus ; } $ pending = false ; $ partial = false ; foreach ( $ this -> sourcefiles as $ file ) { // The combined file has not yet been generated. // Check the status of each source file. if ( is_a ( $ file , \ core_files \ conversion :: class ) ) { $ status = $ file -> get ( 'status' ) ; switch ( $ status ) { case \ core_files \ conversion :: STATUS_IN_PROGRESS : case \ core_files \ conversion :: STATUS_PENDING : $ pending = true ; break ; // There are 4 status flags, so the only remaining one is complete which is fine. case \ core_files \ conversion :: STATUS_FAILED : $ partial = true ; break ; } } } if ( $ pending ) { return self :: STATUS_PENDING_INPUT ; } else { if ( $ partial ) { return self :: STATUS_READY_PARTIAL ; } return self :: STATUS_READY ; } }
docstring: Check the current status of the document combination.
  Note that the combined document may not contain all the source files if some of the
  source files were not able to be converted. An example is an audio file with a pdf cover sheet. Only
  the cover sheet will be included in the combined document.
  
  @return  int
docstring_tokens: Check the current status of the document combination . Note that the combined document may not contain all the source files if some of the source files were not able to be converted . An example is an audio file with a pdf cover sheet . Only the cover sheet will be included in the combined document .