MediaWiki  master
ChangeTagsLogList.php
Go to the documentation of this file.
1 <?php
23 
29  public function getType() {
30  return 'logentry';
31  }
32 
37  public function doQuery( $db ) {
38  $ids = array_map( 'intval', $this->ids );
40  $queryInfo['conds'] += [ 'log_id' => $ids ];
41  $queryInfo['options'] += [ 'ORDER BY' => 'log_id DESC' ];
43  $queryInfo['tables'],
44  $queryInfo['fields'],
45  $queryInfo['conds'],
46  $queryInfo['join_conds'],
47  $queryInfo['options'],
48  ''
49  );
50  return $db->select(
51  $queryInfo['tables'],
52  $queryInfo['fields'],
53  $queryInfo['conds'],
54  __METHOD__,
55  $queryInfo['options'],
56  $queryInfo['join_conds']
57  );
58  }
59 
60  public function newItem( $row ) {
61  return new ChangeTagsLogItem( $this, $row );
62  }
63 
74  public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
75  for ( $this->reset(); $this->current(); $this->next() ) {
76  $item = $this->current();
77  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
78  null, null, $item->getId(), $params, $reason, $user );
79  // Should only fail on second and subsequent times if the user trips
80  // the rate limiter
81  if ( !$status->isOK() ) {
82  break;
83  }
84  }
85 
86  return $status;
87  }
88 }
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
Definition: ChangeTags.php:777
reset()
Start iteration.
current()
Get the current list item, or false if we are at the end.
Stores a list of taggable log entries.
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
next()
Move the iteration pointer to the next list item, and return it.
Item class for a logging table row with its associated change tags.
static updateTagsWithChecks( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id, $log_id, $params, $reason, User $user)
Adds and/or removes tags to/from a given change, checking whether it is allowed first, and adding a log entry afterwards.
Definition: ChangeTags.php:668
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user)
Add/remove change tags from all the log entries in the list.