MediaWiki
REL1_41
RevDelArchivedFileList.php
Go to the documentation of this file.
1
<?php
22
use
MediaWiki\FileRepo\File\FileSelectQueryBuilder
;
23
use
MediaWiki\Page\PageIdentity
;
24
use
Wikimedia\Rdbms\IDatabase
;
25
use
Wikimedia\Rdbms\IResultWrapper
;
26
use
Wikimedia\Rdbms\LBFactory
;
27
use
Wikimedia\Rdbms\SelectQueryBuilder
;
28
32
class
RevDelArchivedFileList
extends
RevDelFileList
{
33
42
public
function
__construct
(
43
IContextSource
$context,
44
PageIdentity
$page
,
45
array
$ids
,
46
LBFactory
$lbFactory,
47
HtmlCacheUpdater
$htmlCacheUpdater,
48
RepoGroup
$repoGroup
49
) {
50
parent::__construct(
51
$context,
52
$page
,
53
$ids
,
54
$lbFactory,
55
$htmlCacheUpdater,
56
$repoGroup
57
);
58
// Technically, we could just inherit the constructor from RevDelFileList,
59
// but since ArchivedFile::getQueryInfo() uses MediaWikiServices it might
60
// be useful to replace at some point with either a callback or a separate
61
// service to allow for unit testing
62
}
63
64
public
function
getType
() {
65
return
'filearchive'
;
66
}
67
68
public
static
function
getRelationType
() {
69
return
'fa_id'
;
70
}
71
76
public
function
doQuery
( $db ) {
77
$ids
= array_map(
'intval'
, $this->ids );
78
79
$queryBuilder = FileSelectQueryBuilder::newForArchivedFile( $db );
80
$queryBuilder->where( [
'fa_name'
=> $this->page->getDBkey(),
'fa_id'
=>
$ids
] )
81
->orderBy(
'fa_id'
, SelectQueryBuilder::SORT_DESC );
82
83
return
$queryBuilder->caller( __METHOD__ )->fetchResultSet();
84
}
85
86
public
function
newItem
( $row ) {
87
return
new
RevDelArchivedFileItem
( $this, $row );
88
}
89
}
HtmlCacheUpdater
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Definition
HtmlCacheUpdater.php:33
MediaWiki\FileRepo\File\FileSelectQueryBuilder
Definition
FileSelectQueryBuilder.php:27
RepoGroup
Prioritized list of file repositories.
Definition
RepoGroup.php:30
RevDelArchivedFileItem
Definition
RevDelArchivedFileItem.php:31
RevDelArchivedFileList
List for filearchive table items.
Definition
RevDelArchivedFileList.php:32
RevDelArchivedFileList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition
RevDelArchivedFileList.php:68
RevDelArchivedFileList\__construct
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HtmlCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
Definition
RevDelArchivedFileList.php:42
RevDelArchivedFileList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition
RevDelArchivedFileList.php:86
RevDelArchivedFileList\doQuery
doQuery( $db)
Definition
RevDelArchivedFileList.php:76
RevDelArchivedFileList\getType
getType()
Get the internal type name of this list.
Definition
RevDelArchivedFileList.php:64
RevDelFileList
List for oldimage table items.
Definition
RevDelFileList.php:33
RevisionListBase\$page
PageIdentity $page
Definition
RevisionListBase.php:35
RevisionListBase\$ids
int[] null $ids
Definition
RevisionListBase.php:38
Wikimedia\Rdbms\LBFactory
Definition
LBFactory.php:40
Wikimedia\Rdbms\SelectQueryBuilder
Build SELECT queries with a fluent interface.
Definition
SelectQueryBuilder.php:24
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition
IContextSource.php:64
MediaWiki\Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition
PageIdentity.php:67
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition
IDatabase.php:36
Wikimedia\Rdbms\IResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition
IResultWrapper.php:26
includes
revisiondelete
RevDelArchivedFileList.php
Generated on Wed Nov 27 2024 07:24:46 for MediaWiki by
1.10.0