MediaWiki  master
ChangeTagsLogList.php
Go to the documentation of this file.
1 <?php
26 
32  public function getType() {
33  return 'logentry';
34  }
35 
40  public function doQuery( $db ) {
41  $ids = array_map( 'intval', $this->ids );
43  $queryInfo['conds'] += [ 'log_id' => $ids ];
44  $queryInfo['options'] += [ 'ORDER BY' => [ 'log_timestamp DESC', 'log_id DESC' ] ];
46  $queryInfo['tables'],
47  $queryInfo['fields'],
48  $queryInfo['conds'],
49  $queryInfo['join_conds'],
50  $queryInfo['options'],
51  ''
52  );
53  return $db->select(
54  $queryInfo['tables'],
55  $queryInfo['fields'],
56  $queryInfo['conds'],
57  __METHOD__,
58  $queryInfo['options'],
59  $queryInfo['join_conds']
60  );
61  }
62 
63  public function newItem( $row ) {
64  return new ChangeTagsLogItem( $this, $row );
65  }
66 
77  public function updateChangeTagsOnAll(
78  array $tagsToAdd,
79  array $tagsToRemove,
80  ?string $params,
81  string $reason,
82  Authority $performer
83  ) {
84  $status = Status::newGood();
85  for ( $this->reset(); $this->current(); $this->next() ) {
86  $item = $this->current();
87  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
88  null, null, $item->getId(), $params, $reason, $performer );
89  // Should only fail on second and subsequent times if the user trips
90  // the rate limiter
91  if ( !$status->isOK() ) {
92  break;
93  }
94  }
95 
96  return $status;
97  }
98 }
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.
Definition: ChangeTags.php:631
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,...
Definition: ChangeTags.php:520
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: Status.php:58
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:36
Result wrapper for grabbing data queried from an IDatabase object.