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