MediaWiki
master
ApiClearHasMsg.php
Go to the documentation of this file.
1
<?php
2
24
use
MediaWiki\User\TalkPageNotificationManager
;
25
30
class
ApiClearHasMsg
extends
ApiBase
{
31
32
private
TalkPageNotificationManager
$talkPageNotificationManager;
33
39
public
function
__construct
(
40
ApiMain
$main,
41
$action,
42
TalkPageNotificationManager
$talkPageNotificationManager
43
) {
44
parent::__construct( $main, $action );
45
$this->talkPageNotificationManager = $talkPageNotificationManager;
46
}
47
48
public
function
execute
() {
49
$this->talkPageNotificationManager->removeUserHasNewMessages( $this->
getUser
() );
50
51
$this->
getResult
()->addValue(
null
, $this->
getModuleName
(),
'success'
);
52
}
53
54
public
function
isWriteMode
() {
55
return
true
;
56
}
57
58
public
function
mustBePosted
() {
59
return
true
;
60
}
61
62
protected
function
getExamplesMessages
() {
63
return
[
64
'action=clearhasmsg'
65
=>
'apihelp-clearhasmsg-example-1'
,
66
];
67
}
68
69
public
function
getHelpUrls
() {
70
return
'https://www.mediawiki.org/wiki/Special:MyLanguage/API:ClearHasMsg'
;
71
}
72
}
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition:
ApiBase.php:62
ApiBase\getResult
getResult()
Get the result object.
Definition:
ApiBase.php:667
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition:
ApiBase.php:528
ApiClearHasMsg
API module that clears the hasmsg flag for current user.
Definition:
ApiClearHasMsg.php:30
ApiClearHasMsg\mustBePosted
mustBePosted()
Indicates whether this module must be called with a POST request.
Definition:
ApiClearHasMsg.php:58
ApiClearHasMsg\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition:
ApiClearHasMsg.php:62
ApiClearHasMsg\isWriteMode
isWriteMode()
Indicates whether this module requires write mode.
Definition:
ApiClearHasMsg.php:54
ApiClearHasMsg\__construct
__construct(ApiMain $main, $action, TalkPageNotificationManager $talkPageNotificationManager)
Definition:
ApiClearHasMsg.php:39
ApiClearHasMsg\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition:
ApiClearHasMsg.php:69
ApiClearHasMsg\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition:
ApiClearHasMsg.php:48
ApiMain
This is the main API class, used for both external and internal processing.
Definition:
ApiMain.php:64
ContextSource\getUser
getUser()
Definition:
ContextSource.php:152
MediaWiki\User\TalkPageNotificationManager
Manages user talk page notifications.
Definition:
TalkPageNotificationManager.php:39
includes
api
ApiClearHasMsg.php
Generated on Tue Oct 3 2023 03:08:16 for MediaWiki by
1.9.1