44 parent::__construct( $main, $action );
45 $this->revisionStore = $revisionStore;
55 if ( isset(
$params[
'rcid'] ) ) {
56 $rc = RecentChange::newFromId(
$params[
'rcid'] );
61 $rev = $this->revisionStore->getRevisionById(
$params[
'revid'] );
65 $rc = $this->revisionStore->getRecentChange( $rev );
75 if ( $tags !==
null ) {
77 if ( !$ableToTag->isOK() ) {
82 $status = $rc->markPatrolled( $user, $tags );
84 if ( !$status->isGood() ) {
88 $result = [
'rcid' => (int)$rc->getAttribute(
'rc_id' ) ];
104 ParamValidator::PARAM_TYPE =>
'integer'
107 ParamValidator::PARAM_TYPE =>
'integer'
110 ParamValidator::PARAM_TYPE =>
'tags',
111 ParamValidator::PARAM_ISMULTI =>
true,
122 'action=patrol&token=123ABC&rcid=230672766'
123 =>
'apihelp-patrol-example-rcid',
124 'action=patrol&token=123ABC&revid=230672766'
125 =>
'apihelp-patrol-example-revid',
130 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Patrol';
135class_alias( ApiPatrol::class,
'ApiPatrol' );
array $params
The job parameters.
This is the main API class, used for both external and internal processing.
Utility class for creating and reading rows in the recentchanges table.