MediaWiki  master
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 );
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( $tagsToAdd, $tagsToRemove, $params, $reason, Authority $performer ) {
76  $status = Status::newGood();
77  for ( $this->reset(); $this->current(); $this->next() ) {
78  $item = $this->current();
79  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
80  null, null, $item->getId(), $params, $reason, $performer );
81  // Should only fail on second and subsequent times if the user trips
82  // the rate limiter
83  if ( !$status->isOK() ) {
84  break;
85  }
86  }
87 
88  return $status;
89  }
90 }
ChangeTagsList
Definition: ChangeTagsList.php:32
ChangeTags\updateTagsWithChecks
static updateTagsWithChecks( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id, $log_id, $params, $reason, Authority $performer)
Adds and/or removes tags to/from a given change, checking whether it is allowed first,...
Definition: ChangeTags.php:784
DatabaseLogEntry\getSelectQueryData
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition: DatabaseLogEntry.php:52
ChangeTagsLogItem
Item class for a logging table row with its associated change tags.
Definition: ChangeTagsLogItem.php:31
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ChangeTags\modifyDisplayQuery
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
Definition: ChangeTags.php:896
RevisionListBase\next
next()
Move the iteration pointer to the next list item, and return it.
Definition: RevisionListBase.php:134
RevisionListBase\current
current()
Get the current list item, or false if we are at the end.
Definition: RevisionListBase.php:125
ChangeTagsLogList\doQuery
doQuery( $db)
Definition: ChangeTagsLogList.php:38
RevisionListBase\reset
reset()
Start iteration.
Definition: RevisionListBase.php:107
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition: Authority.php:37
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
RevisionListBase\$ids
int[] null $ids
Definition: RevisionListBase.php:37
ChangeTagsLogList
Stores a list of taggable log entries.
Definition: ChangeTagsLogList.php:29
ChangeTagsLogList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: ChangeTagsLogList.php:61
ChangeTagsLogList\updateChangeTagsOnAll
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, Authority $performer)
Add/remove change tags from all the log entries in the list.
Definition: ChangeTagsLogList.php:75
ChangeTagsLogList\getType
getType()
Get the internal type name of this list.
Definition: ChangeTagsLogList.php:30