MediaWiki  master
RevDelArchivedFileList.php
Go to the documentation of this file.
1 <?php
25 
30 
39  public function __construct(
41  PageIdentity $page,
42  array $ids,
46  ) {
47  parent::__construct(
48  $context,
49  $page,
50  $ids,
51  $lbFactory,
54  );
55  // Technically, we could just inherit the constructor from RevDelFileList,
56  // but since ArchivedFile::getQueryInfo() uses MediaWikiServices it might
57  // be useful to replace at some point with either a callback or a separate
58  // service to allow for unit testing
59  }
60 
61  public function getType() {
62  return 'filearchive';
63  }
64 
65  public static function getRelationType() {
66  return 'fa_id';
67  }
68 
73  public function doQuery( $db ) {
74  $ids = array_map( 'intval', $this->ids );
75 
76  $fileQuery = ArchivedFile::getQueryInfo();
77  return $db->select(
78  $fileQuery['tables'],
79  $fileQuery['fields'],
80  [
81  'fa_name' => $this->title->getDBkey(),
82  'fa_id' => $ids
83  ],
84  __METHOD__,
85  [ 'ORDER BY' => 'fa_id DESC' ],
86  $fileQuery['joins']
87  );
88  }
89 
90  public function newItem( $row ) {
91  return new RevDelArchivedFileItem( $this, $row );
92  }
93 }
RevDelArchivedFileList\__construct
__construct(IContextSource $context, PageIdentity $page, array $ids, LBFactory $lbFactory, HtmlCacheUpdater $htmlCacheUpdater, RepoGroup $repoGroup)
Definition: RevDelArchivedFileList.php:39
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:64
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:39
RevDelArchivedFileList\getType
getType()
Get the internal type name of this list.
Definition: RevDelArchivedFileList.php:61
RevDelArchivedFileList\doQuery
doQuery( $db)
Definition: RevDelArchivedFileList.php:73
ArchivedFile\getQueryInfo
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
Definition: ArchivedFile.php:247
RevDelFileList\$repoGroup
RepoGroup $repoGroup
Definition: RevDelFileList.php:35
RevDelArchivedFileList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevDelArchivedFileList.php:65
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
RevDelList\$lbFactory
LBFactory $lbFactory
Definition: RevDelList.php:40
RevDelFileList\$htmlCacheUpdater
HtmlCacheUpdater $htmlCacheUpdater
Definition: RevDelFileList.php:32
RevDelArchivedFileItem
Definition: RevDelArchivedFileItem.php:31
RevDelArchivedFileList
List for filearchive table items.
Definition: RevDelArchivedFileList.php:29
RevisionListBase\$ids
int[] null $ids
Definition: RevisionListBase.php:37
HtmlCacheUpdater
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Definition: HtmlCacheUpdater.php:32
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:58
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:42
RepoGroup
Prioritized list of file repositories.
Definition: RepoGroup.php:32
RevDelArchivedFileList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevDelArchivedFileList.php:90
RevDelFileList
List for oldimage table items.
Definition: RevDelFileList.php:29