MediaWiki REL1_39
ChangeTagsLogList.php
Go to the documentation of this file.
1<?php
24
30 public function getType() {
31 return 'logentry';
32 }
33
38 public function doQuery( $db ) {
39 $ids = array_map( 'intval', $this->ids );
40 $queryInfo = DatabaseLogEntry::getSelectQueryData();
41 $queryInfo['conds'] += [ 'log_id' => $ids ];
42 $queryInfo['options'] += [ 'ORDER BY' => 'log_id DESC' ];
44 $queryInfo['tables'],
45 $queryInfo['fields'],
46 $queryInfo['conds'],
47 $queryInfo['join_conds'],
48 $queryInfo['options'],
49 ''
50 );
51 return $db->select(
52 $queryInfo['tables'],
53 $queryInfo['fields'],
54 $queryInfo['conds'],
55 __METHOD__,
56 $queryInfo['options'],
57 $queryInfo['join_conds']
58 );
59 }
60
61 public function newItem( $row ) {
62 return new ChangeTagsLogItem( $this, $row );
63 }
64
75 public function updateChangeTagsOnAll(
76 array $tagsToAdd,
77 array $tagsToRemove,
78 ?string $params,
79 string $reason,
80 Authority $performer
81 ) {
82 $status = Status::newGood();
83 for ( $this->reset(); $this->current(); $this->next() ) {
84 $item = $this->current();
85 $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
86 null, null, $item->getId(), $params, $reason, $performer );
87 // Should only fail on second and subsequent times if the user trips
88 // the rate limiter
89 if ( !$status->isOK() ) {
90 break;
91 }
92 }
93
94 return $status;
95 }
96}
Item class for a logging table row with its associated change tags.
Stores a list of taggable log entries.
updateChangeTagsOnAll(array $tagsToAdd, array $tagsToRemove, ?string $params, string $reason, Authority $performer)
Add/remove change tags from all the log entries in the list.
newItem( $row)
Create an item object from a DB result row.
getType()
Get the internal type name of this list.
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='', bool $exclude=false)
Applies all tags-related changes to a query.
static updateTagsWithChecks( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id, $log_id, $params, string $reason, Authority $performer)
Adds and/or removes tags to/from a given change, checking whether it is allowed first,...
reset()
Start iteration.
current()
Get the current list item, or false if we are at the end.
next()
Move the iteration pointer to the next list item, and return it.
This interface represents the authority associated the current execution context, such as a web reque...
Definition Authority.php:37
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:39