MediaWiki master
RevDelArchiveList.php
Go to the documentation of this file.
1<?php
32
37
39 private $revisionStore;
40
50 public function __construct(
51 IContextSource $context,
53 array $ids,
54 LBFactory $lbFactory,
55 HookContainer $hookContainer,
56 HTMLCacheUpdater $htmlCacheUpdater,
57 RevisionStore $revisionStore
58 ) {
59 parent::__construct(
60 $context,
61 $page,
62 $ids,
63 $lbFactory,
64 $hookContainer,
65 $htmlCacheUpdater,
66 $revisionStore
67 );
68 $this->revisionStore = $revisionStore;
69 }
70
71 public function getType() {
72 return 'archive';
73 }
74
75 public static function getRelationType() {
76 return 'ar_timestamp';
77 }
78
83 public function doQuery( $db ) {
84 $timestamps = [];
85 foreach ( $this->ids as $id ) {
86 $timestamps[] = $db->timestamp( $id );
87 }
88
89 $queryBuilder = $this->revisionStore->newArchiveSelectQueryBuilder( $db )
90 ->joinComment()
91 ->where( [
92 'ar_namespace' => $this->getPage()->getNamespace(),
93 'ar_title' => $this->getPage()->getDBkey(),
94 'ar_timestamp' => $timestamps,
95 ] )
96 ->orderBy( 'ar_timestamp', SelectQueryBuilder::SORT_DESC );
97
98 MediaWikiServices::getInstance()->getChangeTagsStore()->modifyDisplayQueryBuilder( $queryBuilder, 'archive' );
99
100 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
101 }
102
103 public function newItem( $row ) {
104 return new RevDelArchiveItem( $this, $row );
105 }
106
107 public function doPreCommitUpdates() {
108 return Status::newGood();
109 }
110
111 public function doPostCommitUpdates( array $visibilityChangeMap ) {
112 return Status::newGood();
113 }
114}
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Service locator for MediaWiki core services.
Service for looking up page revisions.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
Item class for a archive table row.
List for archive table items, i.e.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
newItem( $row)
Create an item object from a DB result row.
static getRelationType()
Get the DB field name associated with the ID list.
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
getType()
Get the internal type name of this list.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HookContainer $hookContainer, HTMLCacheUpdater $htmlCacheUpdater, RevisionStore $revisionStore)
List for revision table items.
Build SELECT queries with a fluent interface.
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
Result wrapper for grabbing data queried from an IDatabase object.