MediaWiki REL1_37
ChangeTagsList.php
Go to the documentation of this file.
1<?php
23
32abstract class ChangeTagsList extends RevisionListBase {
33 public function __construct( IContextSource $context, Title $title, array $ids ) {
34 parent::__construct( $context, $title );
35 $this->ids = $ids;
36 }
37
48 public static function factory( $typeName, IContextSource $context,
49 Title $title, array $ids
50 ) {
51 switch ( $typeName ) {
52 case 'revision':
53 $className = ChangeTagsRevisionList::class;
54 break;
55 case 'logentry':
56 $className = ChangeTagsLogList::class;
57 break;
58 default:
59 throw new Exception( "Class $typeName requested, but does not exist" );
60 }
61
62 return new $className( $context, $title, $ids );
63 }
64
68 public function reloadFromPrimary() {
69 $dbw = wfGetDB( DB_PRIMARY );
70 $this->res = $this->doQuery( $dbw );
71 }
72
83 abstract public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
84 $reason, Authority $performer );
85}
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
reloadFromPrimary()
Reload the list data from the primary DB.
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, Authority $performer)
Add/remove change tags from all the items in the list.
static factory( $typeName, IContextSource $context, Title $title, array $ids)
Creates a ChangeTags*List of the requested type.
__construct(IContextSource $context, Title $title, array $ids)
IContextSource $context
List for revision table items for a single page.
doQuery( $db)
Do the DB query to iterate through the objects.
Represents a title within MediaWiki.
Definition Title.php:48
Interface for objects which can provide a MediaWiki context on request.
This interface represents the authority associated the current execution context, such as a web reque...
Definition Authority.php:37
const DB_PRIMARY
Definition defines.php:27