MediaWiki REL1_41
RevDelArchiveList.php
Go to the documentation of this file.
1<?php
30
35
37 private $revisionStore;
38
48 public function __construct(
49 IContextSource $context,
51 array $ids,
52 LBFactory $lbFactory,
53 HookContainer $hookContainer,
54 HtmlCacheUpdater $htmlCacheUpdater,
55 RevisionStore $revisionStore
56 ) {
57 parent::__construct(
58 $context,
59 $page,
60 $ids,
61 $lbFactory,
62 $hookContainer,
63 $htmlCacheUpdater,
64 $revisionStore
65 );
66 $this->revisionStore = $revisionStore;
67 }
68
69 public function getType() {
70 return 'archive';
71 }
72
73 public static function getRelationType() {
74 return 'ar_timestamp';
75 }
76
81 public function doQuery( $db ) {
82 $timestamps = [];
83 foreach ( $this->ids as $id ) {
84 $timestamps[] = $db->timestamp( $id );
85 }
86
87 $queryBuilder = $this->revisionStore->newArchiveSelectQueryBuilder( $db )
88 ->joinComment()
89 ->where( [
90 'ar_namespace' => $this->getPage()->getNamespace(),
91 'ar_title' => $this->getPage()->getDBkey(),
92 'ar_timestamp' => $timestamps,
93 ] )
94 ->orderBy( 'ar_timestamp', SelectQueryBuilder::SORT_DESC );
95
96 MediaWikiServices::getInstance()->getChangeTagsStore()->modifyDisplayQueryBuilder( $queryBuilder, 'archive' );
97
98 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
99 }
100
101 public function newItem( $row ) {
102 return new RevDelArchiveItem( $this, $row );
103 }
104
105 public function doPreCommitUpdates() {
106 return Status::newGood();
107 }
108
109 public function doPostCommitUpdates( array $visibilityChangeMap ) {
110 return Status::newGood();
111 }
112}
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:58
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.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HookContainer $hookContainer, HtmlCacheUpdater $htmlCacheUpdater, RevisionStore $revisionStore)
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
getType()
Get the internal type name of this list.
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.