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