MediaWiki master
ChangeTagsList.php
Go to the documentation of this file.
1<?php
25
34abstract class ChangeTagsList extends RevisionListBase {
35 public function __construct( IContextSource $context, PageIdentity $page, array $ids ) {
36 parent::__construct( $context, $page );
37 $this->ids = $ids;
38 }
39
50 public static function factory( $typeName, IContextSource $context,
51 PageIdentity $page, array $ids
52 ) {
53 switch ( $typeName ) {
54 case 'revision':
55 $className = ChangeTagsRevisionList::class;
56 break;
57 case 'logentry':
58 $className = ChangeTagsLogList::class;
59 break;
60 default:
61 throw new Exception( "Class $typeName requested, but does not exist" );
62 }
63
64 return new $className( $context, $page, $ids );
65 }
66
70 public function reloadFromPrimary() {
71 $dbw = wfGetDB( DB_PRIMARY );
72 $this->res = $this->doQuery( $dbw );
73 }
74
85 abstract public function updateChangeTagsOnAll(
86 array $tagsToAdd,
87 array $tagsToRemove,
88 ?string $params,
89 string $reason,
90 Authority $performer
91 );
92}
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
reloadFromPrimary()
Reload the list data from the primary DB.
__construct(IContextSource $context, PageIdentity $page, array $ids)
updateChangeTagsOnAll(array $tagsToAdd, array $tagsToRemove, ?string $params, string $reason, Authority $performer)
Add/remove change tags from all the items in the list.
static factory( $typeName, IContextSource $context, PageIdentity $page, array $ids)
Creates a ChangeTags*List of the requested type.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
List for revision table items for a single page.
doQuery( $db)
Do the DB query to iterate through the objects.
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
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:28