MediaWiki
master
RevDelArchivedFileList.php
Go to the documentation of this file.
1
<?php
22
use
Wikimedia\Rdbms\IDatabase
;
23
use
Wikimedia\Rdbms\LBFactory
;
24
28
class
RevDelArchivedFileList
extends
RevDelFileList
{
29
38
public
function
__construct
(
39
IContextSource
$context
,
40
Title
$title
,
41
array
$ids
,
42
LBFactory
$lbFactory
,
43
HtmlCacheUpdater
$htmlCacheUpdater
,
44
RepoGroup
$repoGroup
45
) {
46
parent::__construct(
47
$context
,
48
$title
,
49
$ids
,
50
$lbFactory
,
51
$htmlCacheUpdater
,
52
$repoGroup
53
);
54
// Technically, we could just inherit the constructor from RevDelFileList,
55
// but since ArchivedFile::getQueryInfo() uses MediaWikiServices it might
56
// be useful to replace at some point with either a callback or a separate
57
// service to allow for unit testing
58
}
59
60
public
function
getType
() {
61
return
'filearchive'
;
62
}
63
64
public
static
function
getRelationType
() {
65
return
'fa_id'
;
66
}
67
72
public
function
doQuery
( $db ) {
73
$ids
= array_map(
'intval'
, $this->ids );
74
75
$fileQuery =
ArchivedFile::getQueryInfo
();
76
return
$db->select(
77
$fileQuery[
'tables'
],
78
$fileQuery[
'fields'
],
79
[
80
'fa_name'
=> $this->title->getDBkey(),
81
'fa_id'
=>
$ids
82
],
83
__METHOD__,
84
[
'ORDER BY'
=>
'fa_id DESC'
],
85
$fileQuery[
'joins'
]
86
);
87
}
88
89
public
function
newItem
( $row ) {
90
return
new
RevDelArchivedFileItem
( $this, $row );
91
}
92
}
ContextSource\$context
IContextSource $context
Definition:
ContextSource.php:37
RevDelArchivedFileList\getType
getType()
Get the internal type name of this list.
Definition:
RevDelArchivedFileList.php:60
RevDelArchivedFileList\doQuery
doQuery( $db)
Definition:
RevDelArchivedFileList.php:72
ArchivedFile\getQueryInfo
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
Definition:
ArchivedFile.php:234
RevDelArchivedFileList\__construct
__construct(IContextSource $context, Title $title, array $ids, LBFactory $lbFactory, HtmlCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
Definition:
RevDelArchivedFileList.php:38
RevDelFileList\$repoGroup
RepoGroup $repoGroup
Definition:
RevDelFileList.php:34
RevDelArchivedFileList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition:
RevDelArchivedFileList.php:64
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition:
IDatabase.php:38
RevDelList\$lbFactory
LBFactory $lbFactory
Definition:
RevDelList.php:39
RevisionListBase\$title
Title $title
Definition:
RevisionListBase.php:31
RevDelFileList\$htmlCacheUpdater
HtmlCacheUpdater $htmlCacheUpdater
Definition:
RevDelFileList.php:31
RevDelArchivedFileItem
Definition:
RevDelArchivedFileItem.php:31
RevDelArchivedFileList
List for filearchive table items.
Definition:
RevDelArchivedFileList.php:28
RevisionListBase\$ids
int[] null $ids
Definition:
RevisionListBase.php:34
HtmlCacheUpdater
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Definition:
HtmlCacheUpdater.php:30
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition:
IContextSource.php:55
Title
Represents a title within MediaWiki.
Definition:
Title.php:46
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition:
LBFactory.php:41
RepoGroup
Prioritized list of file repositories.
Definition:
RepoGroup.php:31
RevDelArchivedFileList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition:
RevDelArchivedFileList.php:89
RevDelFileList
List for oldimage table items.
Definition:
RevDelFileList.php:28
includes
revisiondelete
RevDelArchivedFileList.php
Generated on Tue Jan 19 2021 02:22:03 for MediaWiki by
1.8.19