- $dbr = wfGetDB( DB_REPLICA );
- $commentQuery = CommentStore::newKey( 'ar_comment' )->getJoin();
-
- $tables = [ 'archive' ] + $commentQuery['tables'];
-
- $fields = [
- 'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text',
- 'ar_len', 'ar_deleted', 'ar_rev_id', 'ar_sha1',
- 'ar_page_id'
- ] + $commentQuery['fields'];
-
- if ( $this->config->get( 'ContentHandlerUseDB' ) ) {
- $fields[] = 'ar_content_format';
- $fields[] = 'ar_content_model';
- }
-
- $conds = [ 'ar_namespace' => $this->title->getNamespace(),
- 'ar_title' => $this->title->getDBkey() ];
+ $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
+ $queryInfo = $revisionStore->getArchiveQueryInfo();