MediaWiki  1.34.0
RevDelArchiveList.php
Go to the documentation of this file.
1 <?php
23 
28  public function getType() {
29  return 'archive';
30  }
31 
32  public static function getRelationType() {
33  return 'ar_timestamp';
34  }
35 
40  public function doQuery( $db ) {
41  $timestamps = [];
42  foreach ( $this->ids as $id ) {
43  $timestamps[] = $db->timestamp( $id );
44  }
45 
46  $arQuery = Revision::getArchiveQueryInfo();
47  $tables = $arQuery['tables'];
48  $fields = $arQuery['fields'];
49  $conds = [
50  'ar_namespace' => $this->title->getNamespace(),
51  'ar_title' => $this->title->getDBkey(),
52  'ar_timestamp' => $timestamps,
53  ];
54  $join_conds = $arQuery['joins'];
55  $options = [ 'ORDER BY' => 'ar_timestamp DESC' ];
56 
58  $tables,
59  $fields,
60  $conds,
61  $join_conds,
62  $options,
63  ''
64  );
65 
66  return $db->select( $tables,
67  $fields,
68  $conds,
69  __METHOD__,
70  $options,
71  $join_conds
72  );
73  }
74 
75  public function newItem( $row ) {
76  return new RevDelArchiveItem( $this, $row );
77  }
78 
79  public function doPreCommitUpdates() {
80  return Status::newGood();
81  }
82 
83  public function doPostCommitUpdates( array $visibilityChangeMap ) {
84  return Status::newGood();
85  }
86 }
Revision\getArchiveQueryInfo
static getArchiveQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archived revision objec...
Definition: Revision.php:329
RevDelArchiveList
List for archive table items, i.e.
Definition: RevDelArchiveList.php:27
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:772
RevDelRevisionList
List for revision table items.
Definition: RevDelRevisionList.php:35
RevDelArchiveList\doPostCommitUpdates
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
Definition: RevDelArchiveList.php:83
RevDelArchiveList\doQuery
doQuery( $db)
Definition: RevDelArchiveList.php:40
RevDelArchiveItem
Item class for a archive table row.
Definition: RevDelArchiveItem.php:25
RevDelArchiveList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevDelArchiveList.php:75
RevDelArchiveList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevDelArchiveList.php:32
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:81
RevDelArchiveList\doPreCommitUpdates
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
Definition: RevDelArchiveList.php:79
RevDelArchiveList\getType
getType()
Get the internal type name of this list.
Definition: RevDelArchiveList.php:28