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  $status = Status::newGood();
76  for ( $this->reset(); $this->current(); $this->next() ) {
77  $item = $this->current();
78  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
79  null, null, $item->getId(), $params, $reason, $user );
80  // Should only fail on second and subsequent times if the user trips
81  // the rate limiter
82  if ( !$status->isOK() ) {
83  break;
84  }
85  }
86 
87  return $status;
88  }
89 }
ChangeTagsList
Definition: ChangeTagsList.php:30
DatabaseLogEntry\getSelectQueryData
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition: DatabaseLogEntry.php:45
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:798
RevisionListBase\next
next()
Move the iteration pointer to the next list item, and return it.
Definition: RevisionListBase.php:112
RevisionListBase\current
current()
Get the current list item, or false if we are at the end.
Definition: RevisionListBase.php:103
ChangeTagsLogList\doQuery
doQuery( $db)
Definition: ChangeTagsLogList.php:37
RevisionListBase\reset
reset()
Start iteration.
Definition: RevisionListBase.php:85
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
RevisionListBase\$ids
array $ids
Definition: RevisionListBase.php:34
ChangeTagsLogList
Stores a list of taggable log entries.
Definition: ChangeTagsLogList.php:28
ChangeTagsLogList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: ChangeTagsLogList.php:60
ChangeTagsLogList\getType
getType()
Get the internal type name of this list.
Definition: ChangeTagsLogList.php:29
ChangeTagsLogList\updateChangeTagsOnAll
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user)
Add/remove change tags from all the log entries in the list.
Definition: ChangeTagsLogList.php:74
ChangeTags\updateTagsWithChecks
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,...
Definition: ChangeTags.php:687