MediaWiki  master
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 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:157
RevDelArchiveList
List for archive table items, i.e.
Definition: RevDelArchiveList.php:28
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ChangeTags\modifyDisplayQuery
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
Definition: ChangeTags.php:798
RevDelRevisionList
List for revision table items.
Definition: RevDelRevisionList.php:37
RevDelArchiveList\doPostCommitUpdates
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
Definition: RevDelArchiveList.php:86
RevDelArchiveList\doQuery
doQuery( $db)
Definition: RevDelArchiveList.php:41
RevDelArchiveItem
Item class for a archive table row.
Definition: RevDelArchiveItem.php:28
RevDelArchiveList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevDelArchiveList.php:78
RevDelArchiveList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevDelArchiveList.php:33
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
RevDelArchiveList\doPreCommitUpdates
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
Definition: RevDelArchiveList.php:82
RevDelArchiveList\getType
getType()
Get the internal type name of this list.
Definition: RevDelArchiveList.php:29