MediaWiki REL1_37
RevDelArchiveList.php
Go to the documentation of this file.
1<?php
27
32
35
46 public function __construct(
48 PageIdentity $page,
49 array $ids,
51 HookContainer $hookContainer,
55 ) {
56 parent::__construct(
58 $page,
59 $ids,
61 $hookContainer,
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 $arQuery = $this->revisionStore->getArchiveQueryInfo();
88 $tables = $arQuery['tables'];
89 $fields = $arQuery['fields'];
90 $conds = [
91 'ar_namespace' => $this->getPage()->getNamespace(),
92 'ar_title' => $this->getPage()->getDBkey(),
93 'ar_timestamp' => $timestamps,
94 ];
95 $join_conds = $arQuery['joins'];
96 $options = [ 'ORDER BY' => 'ar_timestamp DESC' ];
97
99 $tables,
100 $fields,
101 $conds,
102 $join_conds,
103 $options,
104 ''
105 );
106
107 return $db->select( $tables,
108 $fields,
109 $conds,
110 __METHOD__,
111 $options,
112 $join_conds
113 );
114 }
115
116 public function newItem( $row ) {
117 return new RevDelArchiveItem( $this, $row );
118 }
119
120 public function doPreCommitUpdates() {
121 return Status::newGood();
122 }
123
124 public function doPostCommitUpdates( array $visibilityChangeMap ) {
125 return Status::newGood();
126 }
127}
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
IContextSource $context
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Service for looking up page revisions.
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.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HookContainer $hookContainer, HtmlCacheUpdater $htmlCacheUpdater, RevisionStore $revisionStore, WANObjectCache $wanObjectCache)
static getRelationType()
Get the DB field name associated with the ID list.
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.
WANObjectCache $wanObjectCache
HtmlCacheUpdater $htmlCacheUpdater
Multi-datacenter aware caching interface.
An interface for generating database load balancers.
Definition LBFactory.php:42
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38