MediaWiki
REL1_39
ApiClearHasMsg.php
Go to the documentation of this file.
1
<?php
2
24
use
MediaWiki\User\TalkPageNotificationManager
;
25
30
class
ApiClearHasMsg
extends
ApiBase
{
31
33
private
$talkPageNotificationManager;
34
40
public
function
__construct
(
41
ApiMain
$main,
42
$action,
43
TalkPageNotificationManager
$talkPageNotificationManager
44
) {
45
parent::__construct( $main, $action );
46
$this->talkPageNotificationManager = $talkPageNotificationManager;
47
}
48
49
public
function
execute
() {
50
$this->talkPageNotificationManager->removeUserHasNewMessages( $this->
getUser
() );
51
52
$this->
getResult
()->addValue(
null
, $this->
getModuleName
(),
'success'
);
53
}
54
55
public
function
isWriteMode
() {
56
return
true
;
57
}
58
59
public
function
mustBePosted
() {
60
return
true
;
61
}
62
63
protected
function
getExamplesMessages
() {
64
return
[
65
'action=clearhasmsg'
66
=>
'apihelp-clearhasmsg-example-1'
,
67
];
68
}
69
70
public
function
getHelpUrls
() {
71
return
'https://www.mediawiki.org/wiki/Special:MyLanguage/API:ClearHasMsg'
;
72
}
73
}
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition
ApiBase.php:56
ApiBase\getResult
getResult()
Get the result object.
Definition
ApiBase.php:629
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition
ApiBase.php:498
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:59
ApiClearHasMsg\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition
ApiClearHasMsg.php:63
ApiClearHasMsg\isWriteMode
isWriteMode()
Indicates whether this module requires write mode.
Definition
ApiClearHasMsg.php:55
ApiClearHasMsg\__construct
__construct(ApiMain $main, $action, TalkPageNotificationManager $talkPageNotificationManager)
Definition
ApiClearHasMsg.php:40
ApiClearHasMsg\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition
ApiClearHasMsg.php:70
ApiClearHasMsg\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition
ApiClearHasMsg.php:49
ApiMain
This is the main API class, used for both external and internal processing.
Definition
ApiMain.php:52
ContextSource\getUser
getUser()
Definition
ContextSource.php:147
MediaWiki\User\TalkPageNotificationManager
Manages user talk page notifications.
Definition
TalkPageNotificationManager.php:39
includes
api
ApiClearHasMsg.php
Generated on Sun Nov 24 2024 13:22:18 for MediaWiki by
1.10.0