MediaWiki master
ChangeTagsLogList.php
Go to the documentation of this file.
1<?php
26
34 public function getType() {
35 return 'logentry';
36 }
37
42 public function doQuery( $db ) {
43 $ids = array_map( 'intval', $this->ids );
44 $queryBuilder = DatabaseLogEntry::newSelectQueryBuilder( $db )
45 ->where( [ 'log_id' => $ids ] )
46 ->orderBy( [ 'log_timestamp', 'log_id' ], SelectQueryBuilder::SORT_DESC );
47
48 MediaWikiServices::getInstance()->getChangeTagsStore()->modifyDisplayQueryBuilder( $queryBuilder, 'logging' );
49 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
50 }
51
52 public function newItem( $row ) {
53 return new ChangeTagsLogItem( $this, $row );
54 }
55
66 public function updateChangeTagsOnAll(
67 array $tagsToAdd,
68 array $tagsToRemove,
69 ?string $params,
70 string $reason,
71 Authority $performer
72 ) {
73 $status = Status::newGood();
74 for ( $this->reset(); $this->current(); $this->next() ) {
75 $item = $this->current();
76 $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
77 null, null, $item->getId(), $params, $reason, $performer );
78 // Should only fail on second and subsequent times if the user trips
79 // the rate limiter
80 if ( !$status->isOK() ) {
81 break;
82 }
83 }
84
85 return $status;
86 }
87}
array $params
The job parameters.
Item class for a logging table row with its associated change tags.
Store 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 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,...
Service locator for MediaWiki core services.
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.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
Build SELECT queries with a fluent interface.
This interface represents the authority associated with the current execution context,...
Definition Authority.php:37
Result wrapper for grabbing data queried from an IDatabase object.