MediaWiki master
RevDelArchivedFileList.php
Go to the documentation of this file.
1<?php
30
35
44 public function __construct(
45 IContextSource $context,
47 array $ids,
48 LBFactory $lbFactory,
49 HTMLCacheUpdater $htmlCacheUpdater,
50 RepoGroup $repoGroup
51 ) {
52 parent::__construct(
53 $context,
54 $page,
55 $ids,
56 $lbFactory,
57 $htmlCacheUpdater,
58 $repoGroup
59 );
60 // Technically, we could just inherit the constructor from RevDelFileList,
61 // but since ArchivedFile::getQueryInfo() uses MediaWikiServices it might
62 // be useful to replace at some point with either a callback or a separate
63 // service to allow for unit testing
64 }
65
66 public function getType() {
67 return 'filearchive';
68 }
69
70 public static function getRelationType() {
71 return 'fa_id';
72 }
73
78 public function doQuery( $db ) {
79 $ids = array_map( 'intval', $this->ids );
80
81 $queryBuilder = FileSelectQueryBuilder::newForArchivedFile( $db );
82 $queryBuilder->where( [ 'fa_name' => $this->page->getDBkey(), 'fa_id' => $ids ] )
83 ->orderBy( 'fa_id', SelectQueryBuilder::SORT_DESC );
84
85 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
86 }
87
88 public function newItem( $row ) {
89 return new RevDelArchivedFileItem( $this, $row );
90 }
91}
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Definition RepoGroup.php:32
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.
A database connection without write operations.
Result wrapper for grabbing data queried from an IDatabase object.