MediaWiki  1.28.1
ChangeTagsLogList.php
Go to the documentation of this file.
1 <?php
27  public function getType() {
28  return 'logentry';
29  }
30 
35  public function doQuery( $db ) {
36  $ids = array_map( 'intval', $this->ids );
38  $queryInfo['conds'] += [ 'log_id' => $ids ];
39  $queryInfo['options'] += [ 'ORDER BY' => 'log_id DESC' ];
41  $queryInfo['tables'],
42  $queryInfo['fields'],
43  $queryInfo['conds'],
44  $queryInfo['join_conds'],
45  $queryInfo['options'],
46  ''
47  );
48  return $db->select(
49  $queryInfo['tables'],
50  $queryInfo['fields'],
51  $queryInfo['conds'],
52  __METHOD__,
53  $queryInfo['options'],
54  $queryInfo['join_conds']
55  );
56  }
57 
58  public function newItem( $row ) {
59  return new ChangeTagsLogItem( $this, $row );
60  }
61 
72  public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
73  $reason, $user ) {
74 
75  // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
76  for ( $this->reset(); $this->current(); $this->next() ) {
77  // @codingStandardsIgnoreEnd
78  $item = $this->current();
79  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
80  null, null, $item->getId(), $params, $reason, $user );
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 }
reset()
Start iteration.
current()
Get the current list item, or false if we are at the end.
Stores a list of taggable log entries.
updateChangeTagsOnAll($tagsToAdd, $tagsToRemove, $params, $reason, $user)
Add/remove change tags from all the log entries in the list.
$params
Generic list for change tagging.
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition: LogEntry.php:170
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
Definition: hooks.txt:242
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag=false)
Applies all tags-related changes to a query.
Definition: ChangeTags.php:629
next()
Move the iteration pointer to the next list item, and return it.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Item class for a logging table row with its associated change tags.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
Definition: hooks.txt:1046
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:526