MediaWiki 1.41.2
RevDelArchivedFileList.php
Go to the documentation of this file.
1<?php
28
33
42 public function __construct(
43 IContextSource $context,
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}
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Definition RepoGroup.php:30
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.
Build SELECT queries with a fluent interface.
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:36
Result wrapper for grabbing data queried from an IDatabase object.