MediaWiki
master
Toggle main menu visibility
ChangeTagsList.php
Go to the documentation of this file.
1
<?php
6
7
namespace
MediaWiki\ChangeTags;
8
9
use InvalidArgumentException;
10
use MediaWiki\Context\IContextSource;
11
use MediaWiki\MediaWikiServices;
12
use MediaWiki\Page\PageIdentity;
13
use MediaWiki\Permissions\Authority;
14
use MediaWiki\RevisionList\RevisionListBase;
15
use MediaWiki\Status\Status;
16
26
abstract
class
ChangeTagsList
extends
RevisionListBase
{
27
public
function
__construct
(
IContextSource
$context,
PageIdentity
$page
, array
$ids
) {
28
parent::__construct( $context,
$page
);
29
$this->ids =
$ids
;
30
}
31
42
public
static
function
factory
( $typeName,
IContextSource
$context,
43
PageIdentity
$page
, array
$ids
44
) {
45
$className = match ( $typeName ) {
46
'revision'
=> ChangeTagsRevisionList::class,
47
'logentry'
=> ChangeTagsLogList::class,
48
default
=>
throw
new
InvalidArgumentException(
"Class $typeName requested, but does not exist"
)
49
};
50
return
new
$className( $context,
$page
,
$ids
);
51
}
52
56
public
function
reloadFromPrimary
() {
57
$dbw =
MediaWikiServices::getInstance
()->getConnectionProvider()->getPrimaryDatabase();
58
$this->res = $this->
doQuery
( $dbw );
59
}
60
71
abstract
public
function
updateChangeTagsOnAll
(
72
array $tagsToAdd,
73
array $tagsToRemove,
74
?
string
$params,
75
string
$reason,
76
Authority
$performer
77
);
78
}
79
81
class_alias( ChangeTagsList::class,
'ChangeTagsList'
);
MediaWiki\ChangeTags\ChangeTagsList
Definition
ChangeTagsList.php:26
MediaWiki\ChangeTags\ChangeTagsList\reloadFromPrimary
reloadFromPrimary()
Reload the list data from the primary DB.
Definition
ChangeTagsList.php:56
MediaWiki\ChangeTags\ChangeTagsList\__construct
__construct(IContextSource $context, PageIdentity $page, array $ids)
Definition
ChangeTagsList.php:27
MediaWiki\ChangeTags\ChangeTagsList\updateChangeTagsOnAll
updateChangeTagsOnAll(array $tagsToAdd, array $tagsToRemove, ?string $params, string $reason, Authority $performer)
Add/remove change tags from all the items in the list.
MediaWiki\ChangeTags\ChangeTagsList\factory
static factory( $typeName, IContextSource $context, PageIdentity $page, array $ids)
Create a ChangeTagsList instance of the given type.
Definition
ChangeTagsList.php:42
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition
MediaWikiServices.php:361
MediaWiki\RevisionList\RevisionListBase
List for revision table items for a single page.
Definition
RevisionListBase.php:25
MediaWiki\RevisionList\RevisionListBase\doQuery
doQuery( $db)
Do the DB query to iterate through the objects.
MediaWiki\RevisionList\RevisionListBase\$ids
int[] null $ids
Definition
RevisionListBase.php:32
MediaWiki\RevisionList\RevisionListBase\$page
PageIdentity $page
Definition
RevisionListBase.php:29
MediaWiki\Context\IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition
IContextSource.php:57
MediaWiki\Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition
PageIdentity.php:53
MediaWiki\Permissions\Authority
This interface represents the authority associated with the current execution context,...
Definition
Authority.php:23
includes
ChangeTags
ChangeTagsList.php
Generated on
for MediaWiki by
1.18.0