original_string: public static function get_async_restores($userid) {
          global $DB;
  
          $select = 'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?';
          $params = array($userid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK, 'restore');
          $restores = $DB->get_records_select(
              'backup_controllers',
              $select,
              $params,
              'timecreated DESC',
              'id, backupid, status, itemid, timecreated');
  
              return $restores;
      }
code: public static function get_async_restores($userid) {
          global $DB;
  
          $select = 'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?';
          $params = array($userid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK, 'restore');
          $restores = $DB->get_records_select(
              'backup_controllers',
              $select,
              $params,
              'timecreated DESC',
              'id, backupid, status, itemid, timecreated');
  
              return $restores;
      }
code_tokens: public static function get_async_restores ( $ userid ) { global $ DB ; $ select = 'userid = ? AND execution = ? AND status < ? AND status > ? AND operation = ?' ; $ params = array ( $ userid , backup :: EXECUTION_DELAYED , backup :: STATUS_FINISHED_ERR , backup :: STATUS_NEED_PRECHECK , 'restore' ) ; $ restores = $ DB -> get_records_select ( 'backup_controllers' , $ select , $ params , 'timecreated DESC' , 'id, backupid, status, itemid, timecreated' ) ; return $ restores ; }
docstring: Get all the current in progress async restores for a user.
  
  @param int $userid Moodle user id.
  @return array $restores List of current restores in progress.
docstring_tokens: Get all the current in progress async restores for a user .