MediaWiki REL1_35
RevDelArchiveList.php
Go to the documentation of this file.
1<?php
24
29 public function getType() {
30 return 'archive';
31 }
32
33 public static function getRelationType() {
34 return 'ar_timestamp';
35 }
36
41 public function doQuery( $db ) {
42 $timestamps = [];
43 foreach ( $this->ids as $id ) {
44 $timestamps[] = $db->timestamp( $id );
45 }
46
47 $arQuery = MediaWikiServices::getInstance()
48 ->getRevisionStore()
49 ->getArchiveQueryInfo();
50 $tables = $arQuery['tables'];
51 $fields = $arQuery['fields'];
52 $conds = [
53 'ar_namespace' => $this->title->getNamespace(),
54 'ar_title' => $this->title->getDBkey(),
55 'ar_timestamp' => $timestamps,
56 ];
57 $join_conds = $arQuery['joins'];
58 $options = [ 'ORDER BY' => 'ar_timestamp DESC' ];
59
61 $tables,
62 $fields,
63 $conds,
64 $join_conds,
65 $options,
66 ''
67 );
68
69 return $db->select( $tables,
70 $fields,
71 $conds,
72 __METHOD__,
73 $options,
74 $join_conds
75 );
76 }
77
78 public function newItem( $row ) {
79 return new RevDelArchiveItem( $this, $row );
80 }
81
82 public function doPreCommitUpdates() {
83 return Status::newGood();
84 }
85
86 public function doPostCommitUpdates( array $visibilityChangeMap ) {
87 return Status::newGood();
88 }
89}
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Item class for a archive table row.
List for archive table items, i.e.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
newItem( $row)
Create an item object from a DB result row.
static getRelationType()
Get the DB field name associated with the ID list.
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
getType()
Get the internal type name of this list.
List for revision table items.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38