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