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