MediaWiki master
ChangeTagsList.php
Go to the documentation of this file.
1<?php
27
37abstract class ChangeTagsList extends RevisionListBase {
38 public function __construct( IContextSource $context, PageIdentity $page, array $ids ) {
39 parent::__construct( $context, $page );
40 $this->ids = $ids;
41 }
42
53 public static function factory( $typeName, IContextSource $context,
54 PageIdentity $page, array $ids
55 ) {
56 switch ( $typeName ) {
57 case 'revision':
58 $className = ChangeTagsRevisionList::class;
59 break;
60 case 'logentry':
61 $className = ChangeTagsLogList::class;
62 break;
63 default:
64 throw new InvalidArgumentException( "Class $typeName requested, but does not exist" );
65 }
66
67 return new $className( $context, $page, $ids );
68 }
69
73 public function reloadFromPrimary() {
74 $dbw = MediaWikiServices::getInstance()->getConnectionProvider()->getPrimaryDatabase();
75 $this->res = $this->doQuery( $dbw );
76 }
77
88 abstract public function updateChangeTagsOnAll(
89 array $tagsToAdd,
90 array $tagsToRemove,
91 ?string $params,
92 string $reason,
93 Authority $performer
94 );
95}
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)
Create a ChangeTagsList instance of the given type.
Service locator for MediaWiki core services.
List for revision table items for a single page.
doQuery( $db)
Do the DB query to iterate through the objects.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
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