MediaWiki REL1_39
RevDelArchivedFileList.php
Go to the documentation of this file.
1<?php
25
30
39 public function __construct(
40 IContextSource $context,
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}
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Definition RepoGroup.php:29
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.
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:39