original_string: public static function get_backup_status_array() {
          global $DB;
  
          $result = array(
              self::BACKUP_STATUS_ERROR => 0,
              self::BACKUP_STATUS_OK => 0,
              self::BACKUP_STATUS_UNFINISHED => 0,
              self::BACKUP_STATUS_SKIPPED => 0,
              self::BACKUP_STATUS_WARNING => 0,
              self::BACKUP_STATUS_NOTYETRUN => 0
          );
  
          $statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
  
          foreach ($statuses as $status) {
              if (empty($status->statuscount)) {
                  $status->statuscount = 0;
              }
              $result[(int)$status->laststatus] += $status->statuscount;
          }
  
          return $result;
      }
code: public static function get_backup_status_array() {
          global $DB;
  
          $result = array(
              self::BACKUP_STATUS_ERROR => 0,
              self::BACKUP_STATUS_OK => 0,
              self::BACKUP_STATUS_UNFINISHED => 0,
              self::BACKUP_STATUS_SKIPPED => 0,
              self::BACKUP_STATUS_WARNING => 0,
              self::BACKUP_STATUS_NOTYETRUN => 0
          );
  
          $statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
  
          foreach ($statuses as $status) {
              if (empty($status->statuscount)) {
                  $status->statuscount = 0;
              }
              $result[(int)$status->laststatus] += $status->statuscount;
          }
  
          return $result;
      }
code_tokens: public static function get_backup_status_array ( ) { global $ DB ; $ result = array ( self :: BACKUP_STATUS_ERROR => 0 , self :: BACKUP_STATUS_OK => 0 , self :: BACKUP_STATUS_UNFINISHED => 0 , self :: BACKUP_STATUS_SKIPPED => 0 , self :: BACKUP_STATUS_WARNING => 0 , self :: BACKUP_STATUS_NOTYETRUN => 0 ) ; $ statuses = $ DB -> get_records_sql ( 'SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus' ) ; foreach ( $ statuses as $ status ) { if ( empty ( $ status -> statuscount ) ) { $ status -> statuscount = 0 ; } $ result [ ( int ) $ status -> laststatus ] += $ status -> statuscount ; } return $ result ; }
docstring: Gets the results from the last automated backup that was run based upon
  the statuses of the courses that were looked at.
  
  @global moodle_database $DB
  @return array
docstring_tokens: Gets the results from the last automated backup that was run based upon the statuses of the courses that were looked at .