MediaWiki master
RevDelArchiveList.php
Go to the documentation of this file.
1<?php
9
22
27
29 private $revisionStore;
30
31 public function __construct(
32 IContextSource $context,
34 array $ids,
35 LBFactory $lbFactory,
36 HookContainer $hookContainer,
37 HTMLCacheUpdater $htmlCacheUpdater,
38 RevisionStore $revisionStore,
39 DomainEventDispatcher $eventDispatcher
40 ) {
41 parent::__construct(
42 $context,
43 $page,
44 $ids,
45 $lbFactory,
46 $hookContainer,
47 $htmlCacheUpdater,
48 $revisionStore,
49 $eventDispatcher
50 );
51 $this->revisionStore = $revisionStore;
52 }
53
55 public function getType() {
56 return 'archive';
57 }
58
60 public static function getRelationType() {
61 return 'ar_timestamp';
62 }
63
68 public function doQuery( $db ) {
69 $timestamps = [];
70 foreach ( $this->ids as $id ) {
71 $timestamps[] = $db->timestamp( $id );
72 }
73
74 $queryBuilder = $this->revisionStore->newArchiveSelectQueryBuilder( $db )
75 ->joinComment()
76 ->where( [
77 'ar_namespace' => $this->getPage()->getNamespace(),
78 'ar_title' => $this->getPage()->getDBkey(),
79 'ar_timestamp' => $timestamps,
80 ] )
81 ->orderBy( 'ar_timestamp', SelectQueryBuilder::SORT_DESC );
82
83 MediaWikiServices::getInstance()->getChangeTagsStore()->modifyDisplayQueryBuilder( $queryBuilder, 'archive' );
84
85 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
86 }
87
89 public function newItem( $row ) {
90 return new RevDelArchiveItem( $this, $row );
91 }
92
94 public function doPreCommitUpdates() {
95 return Status::newGood();
96 }
97
99 public function doPostCommitUpdates( array $visibilityChangeMap ) {
100 return Status::newGood();
101 }
102
110 protected function emitEvents(
111 array $bitPars,
112 array $visibilityChangeMap,
113 array $tags,
114 LogEntry $logEntry,
115 bool $suppressed
116 ) {
117 // Do not emit PageHistoryVisibilityChangedEvent for archived revisions.
118 // We could emit a ArchiveVisibilityChangedEvent in the future.
119 // PageHistoryVisibilityChangedEvent and ArchiveVisibilityChangedEvent
120 // should then share a base class, RevisionVisibilityChangedEvent.
121 }
122
123}
124
126class_alias( RevDelArchiveList::class, 'RevDelArchiveList' );
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.
Item class for a archive table row.
List for archive table items, i.e.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HookContainer $hookContainer, HTMLCacheUpdater $htmlCacheUpdater, RevisionStore $revisionStore, DomainEventDispatcher $eventDispatcher)
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.STUB Status
newItem( $row)
Create an item object from a DB result row.RevisionItemBase
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.STUB Status
emitEvents(array $bitPars, array $visibilityChangeMap, array $tags, LogEntry $logEntry, bool $suppressed)
getType()
Get the internal type name of this list.Equal to the table name. Override this function....
static getRelationType()
Get the DB field name associated with the ID list.This used to populate the log_search table for find...
Service for looking up page revisions.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44
Build SELECT queries with a fluent interface.
Interface for objects which can provide a MediaWiki context on request.
Service for sending domain events to registered listeners.
An individual log entry.
Definition LogEntry.php:24
Interface for objects (potentially) representing an editable wiki page.
Result wrapper for grabbing data queried from an IDatabase object.