MediaWiki master
ChangeTagsList.php
Go to the documentation of this file.
1<?php
27
36abstract class ChangeTagsList extends RevisionListBase {
37 public function __construct( IContextSource $context, PageIdentity $page, array $ids ) {
38 parent::__construct( $context, $page );
39 $this->ids = $ids;
40 }
41
52 public static function factory( $typeName, IContextSource $context,
53 PageIdentity $page, array $ids
54 ) {
55 switch ( $typeName ) {
56 case 'revision':
57 $className = ChangeTagsRevisionList::class;
58 break;
59 case 'logentry':
60 $className = ChangeTagsLogList::class;
61 break;
62 default:
63 throw new InvalidArgumentException( "Class $typeName requested, but does not exist" );
64 }
65
66 return new $className( $context, $page, $ids );
67 }
68
72 public function reloadFromPrimary() {
73 $dbw = MediaWikiServices::getInstance()->getConnectionProvider()->getPrimaryDatabase();
74 $this->res = $this->doQuery( $dbw );
75 }
76
87 abstract public function updateChangeTagsOnAll(
88 array $tagsToAdd,
89 array $tagsToRemove,
90 ?string $params,
91 string $reason,
92 Authority $performer
93 );
94}
array $params
The job parameters.
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.
Service locator for MediaWiki core services.
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 with the current execution context,...
Definition Authority.php:37