MediaWiki REL1_37
RevDelArchivedFileList.php
Go to the documentation of this file.
1<?php
25
30
39 public function __construct(
41 PageIdentity $page,
42 array $ids,
46 ) {
47 parent::__construct(
49 $page,
50 $ids,
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->title->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}
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
IContextSource $context
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Definition RepoGroup.php:33
List for filearchive table items.
static getRelationType()
Get the DB field name associated with the ID list.
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HtmlCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
newItem( $row)
Create an item object from a DB result row.
getType()
Get the internal type name of this list.
List for oldimage table items.
HtmlCacheUpdater $htmlCacheUpdater
RepoGroup $repoGroup
LBFactory $lbFactory
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