MediaWiki master
RevDelArchivedFileList.php
Go to the documentation of this file.
1<?php
17
22
31 public function __construct(
32 IContextSource $context,
34 array $ids,
35 LBFactory $lbFactory,
36 HTMLCacheUpdater $htmlCacheUpdater,
37 RepoGroup $repoGroup
38 ) {
39 parent::__construct(
40 $context,
41 $page,
42 $ids,
43 $lbFactory,
44 $htmlCacheUpdater,
45 $repoGroup
46 );
47 // Technically, we could just inherit the constructor from RevDelFileList,
48 // but since ArchivedFile::getQueryInfo() uses MediaWikiServices it might
49 // be useful to replace at some point with either a callback or a separate
50 // service to allow for unit testing
51 }
52
54 public function getType() {
55 return 'filearchive';
56 }
57
59 public static function getRelationType() {
60 return 'fa_id';
61 }
62
67 public function doQuery( $db ) {
68 $ids = array_map( 'intval', $this->ids );
69
70 $queryBuilder = FileSelectQueryBuilder::newForArchivedFile( $db );
71 $queryBuilder->where( [ 'fa_name' => $this->page->getDBkey(), 'fa_id' => $ids ] )
72 ->orderBy( 'fa_id', SelectQueryBuilder::SORT_DESC );
73
74 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
75 }
76
78 public function newItem( $row ) {
79 return new RevDelArchivedFileItem( $this, $row );
80 }
81}
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Prioritized list of file repositories.
Definition RepoGroup.php:24
List for filearchive table items.
static getRelationType()
Get the DB field name associated with the ID list.This used to populate the log_search table for find...
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HTMLCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
newItem( $row)
Create an item object from a DB result row.RevisionItemBase
getType()
Get the internal type name of this list.Equal to the table name. Override this function....
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.