MediaWiki  1.29.1
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,
75  $reason, $user ) {
76 
77  // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
78  for ( $this->reset(); $this->current(); $this->next() ) {
79  // @codingStandardsIgnoreEnd
80  $item = $this->current();
81  $status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
82  null, null, $item->getId(), $params, $reason, $user );
83  // Should only fail on second and subsequent times if the user trips
84  // the rate limiter
85  if ( !$status->isOK() ) {
86  break;
87  }
88  }
89 
90  return $status;
91  }
92 }
ChangeTagsList
Generic list for change tagging.
Definition: ChangeTagsList.php:25
DatabaseLogEntry\getSelectQueryData
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition: LogEntry.php:172
$status
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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:1049
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
ChangeTagsLogItem
Item class for a logging table row with its associated change tags.
Definition: ChangeTagsLogItem.php:30
$user
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 account $user
Definition: hooks.txt:246
$params
$params
Definition: styleTest.css.php:40
php
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
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40
ChangeTags\modifyDisplayQuery
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag=false)
Applies all tags-related changes to a query.
Definition: ChangeTags.php:632
RevisionListBase\next
next()
Move the iteration pointer to the next list item, and return it.
Definition: RevisionList.php:112
RevisionListBase\current
current()
Get the current list item, or false if we are at the end.
Definition: RevisionList.php:104
ChangeTagsLogList\doQuery
doQuery( $db)
Definition: ChangeTagsLogList.php:37
RevisionListBase\reset
reset()
Start iteration.
Definition: RevisionList.php:86
RevisionListBase\$ids
array $ids
Definition: RevisionList.php:35
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:529