MediaWiki REL1_35
RevDelLogList.php
Go to the documentation of this file.
1<?php
24
29 public function getType() {
30 return 'logging';
31 }
32
33 public static function getRelationType() {
34 return 'log_id';
35 }
36
37 public static function getRestriction() {
38 return 'deletelogentry';
39 }
40
41 public static function getRevdelConstant() {
43 }
44
45 public static function suggestTarget( $target, array $ids ) {
46 $result = wfGetDB( DB_REPLICA )->select( 'logging',
47 'log_type',
48 [ 'log_id' => $ids ],
49 __METHOD__,
50 [ 'DISTINCT' ]
51 );
52 if ( $result->numRows() == 1 ) {
53 // If there's only one type, the target can be set to include it.
54 return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
55 }
56
57 return SpecialPage::getTitleFor( 'Log' );
58 }
59
64 public function doQuery( $db ) {
65 $ids = array_map( 'intval', $this->ids );
66
67 $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
68 $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
69
70 return $db->select(
71 [ 'logging' ] + $commentQuery['tables'] + $actorQuery['tables'],
72 [
73 'log_id',
74 'log_type',
75 'log_action',
76 'log_timestamp',
77 'log_namespace',
78 'log_title',
79 'log_page',
80 'log_params',
81 'log_deleted'
82 ] + $commentQuery['fields'] + $actorQuery['fields'],
83 [ 'log_id' => $ids ],
84 __METHOD__,
85 [ 'ORDER BY' => 'log_id DESC' ],
86 $commentQuery['joins'] + $actorQuery['joins']
87 );
88 }
89
90 public function newItem( $row ) {
91 return new RevDelLogItem( $this, $row );
92 }
93
94 public function getSuppressBit() {
95 return RevisionRecord::DELETED_RESTRICTED;
96 }
97
98 public function getLogAction() {
99 return 'event';
100 }
101
102 public function getLogParams( $params ) {
103 return [
104 '4::ids' => $params['ids'],
105 '5::ofield' => $params['oldBits'],
106 '6::nfield' => $params['newBits'],
107 ];
108 }
109}
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
const DELETED_ACTION
Definition LogPage.php:38
Page revision base class.
Item class for a logging table row.
List for logging table items.
getLogParams( $params)
Get log parameter array.
getLogAction()
Get the log action for this list type.
static getRestriction()
Get the user right required for this list type Override this function.
getSuppressBit()
Get the integer value of the flag used for suppression.
static getRelationType()
Get the DB field name associated with the ID list.
getType()
Get the internal type name of this list.
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
newItem( $row)
Create an item object from a DB result row.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38
const DB_REPLICA
Definition defines.php:25