MediaWiki REL1_35
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 );
39 $queryInfo = DatabaseLogEntry::getSelectQueryData();
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}
Item class for a logging table row with its associated change tags.
Stores a list of taggable log entries.
newItem( $row)
Create an item object from a DB result row.
getType()
Get the internal type name of this list.
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user)
Add/remove change tags from all the log entries in the list.
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
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,...
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.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38