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;
    }
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;
    }
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 ; }
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.
Get all the current in progress async restores for a user .