MediaWiki REL1_39
ApiQueryWatchlist.php
Go to the documentation of this file.
1<?php
28
36
38 private $commentStore;
39
41 private $watchedItemQueryService;
42
44 private $contentLanguage;
45
47 private $namespaceInfo;
48
50 private $genderCache;
51
61 public function __construct(
62 ApiQuery $query,
63 $moduleName,
64 CommentStore $commentStore,
65 WatchedItemQueryService $watchedItemQueryService,
66 Language $contentLanguage,
67 NamespaceInfo $namespaceInfo,
68 GenderCache $genderCache
69 ) {
70 parent::__construct( $query, $moduleName, 'wl' );
71 $this->commentStore = $commentStore;
72 $this->watchedItemQueryService = $watchedItemQueryService;
73 $this->contentLanguage = $contentLanguage;
74 $this->namespaceInfo = $namespaceInfo;
75 $this->genderCache = $genderCache;
76 }
77
78 public function execute() {
79 $this->run();
80 }
81
82 public function executeGenerator( $resultPageSet ) {
83 $this->run( $resultPageSet );
84 }
85
86 private $fld_ids = false, $fld_title = false, $fld_patrol = false,
87 $fld_flags = false, $fld_timestamp = false, $fld_user = false,
88 $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
89 $fld_notificationtimestamp = false, $fld_userid = false,
90 $fld_loginfo = false, $fld_tags;
91
93 private $fld_expiry = false;
94
99 private function run( $resultPageSet = null ) {
100 $params = $this->extractRequestParams();
101
102 $user = $this->getUser();
103 $wlowner = $this->getWatchlistUser( $params );
104
105 if ( $params['prop'] !== null && $resultPageSet === null ) {
106 $prop = array_fill_keys( $params['prop'], true );
107
108 $this->fld_ids = isset( $prop['ids'] );
109 $this->fld_title = isset( $prop['title'] );
110 $this->fld_flags = isset( $prop['flags'] );
111 $this->fld_user = isset( $prop['user'] );
112 $this->fld_userid = isset( $prop['userid'] );
113 $this->fld_comment = isset( $prop['comment'] );
114 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
115 $this->fld_timestamp = isset( $prop['timestamp'] );
116 $this->fld_sizes = isset( $prop['sizes'] );
117 $this->fld_patrol = isset( $prop['patrol'] );
118 $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
119 $this->fld_loginfo = isset( $prop['loginfo'] );
120 $this->fld_tags = isset( $prop['tags'] );
121 $this->fld_expiry = isset( $prop['expiry'] );
122
123 if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
124 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
125 }
126 }
127
128 $options = [
129 'dir' => $params['dir'] === 'older'
132 ];
133
134 if ( $resultPageSet === null ) {
135 $options['includeFields'] = $this->getFieldsToInclude();
136 } else {
137 $options['usedInGenerator'] = true;
138 }
139
140 if ( $params['start'] ) {
141 $options['start'] = $params['start'];
142 }
143 if ( $params['end'] ) {
144 $options['end'] = $params['end'];
145 }
146
147 $startFrom = null;
148 if ( $params['continue'] !== null ) {
149 $cont = explode( '|', $params['continue'] );
150 $this->dieContinueUsageIf( count( $cont ) != 2 );
151 $continueTimestamp = $cont[0];
152 $continueId = (int)$cont[1];
153 $this->dieContinueUsageIf( $continueId != $cont[1] );
154 $startFrom = [ $continueTimestamp, $continueId ];
155 }
156
157 if ( $wlowner !== $user ) {
158 $options['watchlistOwner'] = $wlowner;
159 $options['watchlistOwnerToken'] = $params['token'];
160 }
161
162 if ( $params['namespace'] !== null ) {
163 $options['namespaceIds'] = $params['namespace'];
164 }
165
166 if ( $params['allrev'] ) {
167 $options['allRevisions'] = true;
168 }
169
170 if ( $params['show'] !== null ) {
171 $show = array_fill_keys( $params['show'], true );
172
173 /* Check for conflicting parameters. */
174 if ( $this->showParamsConflicting( $show ) ) {
175 $this->dieWithError( 'apierror-show' );
176 }
177
178 // Check permissions.
179 if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
180 || isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] )
181 ) {
182 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
183 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
184 }
185 }
186
187 $options['filters'] = array_keys( $show );
188 }
189
190 if ( $params['type'] !== null ) {
191 try {
192 $rcTypes = RecentChange::parseToRCType( $params['type'] );
193 if ( $rcTypes ) {
194 $options['rcTypes'] = $rcTypes;
195 }
196 } catch ( Exception $e ) {
197 ApiBase::dieDebug( __METHOD__, $e->getMessage() );
198 }
199 }
200
201 $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
202 if ( $params['user'] !== null ) {
203 $options['onlyByUser'] = $params['user'];
204 }
205 if ( $params['excludeuser'] !== null ) {
206 $options['notByUser'] = $params['excludeuser'];
207 }
208
209 $options['limit'] = $params['limit'];
210
211 $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
212 $this, $params, $options );
213
214 $ids = [];
215 $items = $this->watchedItemQueryService->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
216
217 // Get gender information
218 if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
219 $this->contentLanguage->needsGenderDistinction()
220 ) {
221 $usernames = [];
222 foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
224 $linkTarget = $watchedItem->getTarget();
225 if ( $this->namespaceInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
226 $usernames[] = $linkTarget->getText();
227 }
228 }
229 if ( $usernames !== [] ) {
230 $this->genderCache->doQuery( $usernames, __METHOD__ );
231 }
232 }
233
234 foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
236 if ( $resultPageSet === null ) {
237 $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
238 $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
239 if ( !$fit ) {
240 $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
241 break;
242 }
243 } elseif ( $params['allrev'] ) {
244 $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
245 } else {
246 $ids[] = (int)$recentChangeInfo['rc_cur_id'];
247 }
248 }
249
250 if ( $startFrom !== null ) {
251 $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
252 }
253
254 if ( $resultPageSet === null ) {
255 $this->getResult()->addIndexedTagName(
256 [ 'query', $this->getModuleName() ],
257 'item'
258 );
259 } elseif ( $params['allrev'] ) {
260 $resultPageSet->populateFromRevisionIDs( $ids );
261 } else {
262 $resultPageSet->populateFromPageIDs( $ids );
263 }
264 }
265
266 private function getFieldsToInclude() {
267 $includeFields = [];
268 if ( $this->fld_flags ) {
270 }
271 if ( $this->fld_user || $this->fld_userid || $this->fld_loginfo ) {
273 }
274 if ( $this->fld_user || $this->fld_loginfo ) {
275 $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
276 }
277 if ( $this->fld_comment || $this->fld_parsedcomment ) {
279 }
280 if ( $this->fld_patrol ) {
283 }
284 if ( $this->fld_sizes ) {
286 }
287 if ( $this->fld_loginfo ) {
289 }
290 if ( $this->fld_tags ) {
291 $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
292 }
293 return $includeFields;
294 }
295
296 private function showParamsConflicting( array $show ) {
297 return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
298 && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
299 || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
300 && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
301 || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
302 && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
303 || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
304 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
305 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
306 && isset( $show[WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED] ) )
307 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
308 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
309 || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
310 && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
311 }
312
313 private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
314 /* Determine the title of the page that has been changed. */
315 $target = $watchedItem->getTarget();
316 if ( $target instanceof LinkTarget ) {
317 $title = Title::newFromLinkTarget( $target );
318 } else {
320 }
321 $user = $this->getUser();
322
323 /* Our output data. */
324 $vals = [];
325 $type = (int)$recentChangeInfo['rc_type'];
326 $vals['type'] = RecentChange::parseFromRCType( $type );
327 $anyHidden = false;
328
329 /* Create a new entry in the result for the title. */
330 if ( $this->fld_title || $this->fld_ids ) {
331 // These should already have been filtered out of the query, but just in case.
332 if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
333 $vals['actionhidden'] = true;
334 $anyHidden = true;
335 }
336 if ( $type !== RC_LOG ||
337 LogEventsList::userCanBitfield(
338 $recentChangeInfo['rc_deleted'],
340 $user
341 )
342 ) {
343 if ( $this->fld_title ) {
344 // @phan-suppress-next-line PhanTypeMismatchArgumentNullable castFrom does not return null here
346 }
347 if ( $this->fld_ids ) {
348 $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
349 $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
350 $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
351 }
352 }
353 }
354
355 /* Add user data and 'anon' flag, if user is anonymous. */
356 if ( $this->fld_user || $this->fld_userid ) {
357 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
358 $vals['userhidden'] = true;
359 $anyHidden = true;
360 }
361 if ( RevisionRecord::userCanBitfield(
362 $recentChangeInfo['rc_deleted'],
363 RevisionRecord::DELETED_USER,
364 $user
365 ) ) {
366 if ( $this->fld_userid ) {
367 $vals['userid'] = (int)$recentChangeInfo['rc_user'];
368 // for backwards compatibility
369 $vals['user'] = (int)$recentChangeInfo['rc_user'];
370 }
371
372 if ( $this->fld_user ) {
373 $vals['user'] = $recentChangeInfo['rc_user_text'];
374 }
375
376 $vals['anon'] = !$recentChangeInfo['rc_user'];
377 }
378 }
379
380 /* Add flags, such as new, minor, bot. */
381 if ( $this->fld_flags ) {
382 $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
383 $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
384 $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
385 }
386
387 /* Add sizes of each revision. (Only available on 1.10+) */
388 if ( $this->fld_sizes ) {
389 $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
390 $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
391 }
392
393 /* Add the timestamp. */
394 if ( $this->fld_timestamp ) {
395 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
396 }
397
398 if ( $this->fld_notificationtimestamp ) {
399 $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
400 ? ''
401 : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
402 }
403
404 /* Add edit summary / log summary. */
405 if ( $this->fld_comment || $this->fld_parsedcomment ) {
406 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
407 $vals['commenthidden'] = true;
408 $anyHidden = true;
409 }
410 if ( RevisionRecord::userCanBitfield(
411 $recentChangeInfo['rc_deleted'],
412 RevisionRecord::DELETED_COMMENT,
413 $user
414 ) ) {
415 $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
416 if ( $this->fld_comment ) {
417 $vals['comment'] = $comment;
418 }
419
420 if ( $this->fld_parsedcomment ) {
421 $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
422 }
423 }
424 }
425
426 /* Add the patrolled flag */
427 if ( $this->fld_patrol ) {
428 $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
429 $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
430 $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
431 }
432
433 if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
434 if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
435 $vals['actionhidden'] = true;
436 $anyHidden = true;
437 }
438 if ( LogEventsList::userCanBitfield(
439 $recentChangeInfo['rc_deleted'],
441 $user
442 ) ) {
443 $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
444 $vals['logtype'] = $recentChangeInfo['rc_log_type'];
445 $vals['logaction'] = $recentChangeInfo['rc_log_action'];
446
447 $logFormatter = LogFormatter::newFromRow( $recentChangeInfo );
448 $vals['logparams'] = $logFormatter->formatParametersForApi();
449 $vals['logdisplay'] = $logFormatter->getActionText();
450 }
451 }
452
453 if ( $this->fld_tags ) {
454 if ( $recentChangeInfo['rc_tags'] ) {
455 $tags = explode( ',', $recentChangeInfo['rc_tags'] );
456 ApiResult::setIndexedTagName( $tags, 'tag' );
457 $vals['tags'] = $tags;
458 } else {
459 $vals['tags'] = [];
460 }
461 }
462
463 if ( $this->fld_expiry ) {
464 // Add expiration, T263796
465 $expiry = $watchedItem->getExpiry( TS_ISO_8601 );
466 $vals['expiry'] = ( $expiry ?? false );
467 }
468
469 if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
470 $vals['suppressed'] = true;
471 }
472
473 $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
474 $this, $watchedItem, $recentChangeInfo, $vals );
475
476 return $vals;
477 }
478
479 public function getAllowedParams() {
480 return [
481 'allrev' => false,
482 'start' => [
483 ParamValidator::PARAM_TYPE => 'timestamp'
484 ],
485 'end' => [
486 ParamValidator::PARAM_TYPE => 'timestamp'
487 ],
488 'namespace' => [
489 ParamValidator::PARAM_ISMULTI => true,
490 ParamValidator::PARAM_TYPE => 'namespace'
491 ],
492 'user' => [
493 ParamValidator::PARAM_TYPE => 'user',
494 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
495 ],
496 'excludeuser' => [
497 ParamValidator::PARAM_TYPE => 'user',
498 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
499 ],
500 'dir' => [
501 ParamValidator::PARAM_DEFAULT => 'older',
502 ParamValidator::PARAM_TYPE => [
503 'newer',
504 'older'
505 ],
506 ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
508 'newer' => 'api-help-paramvalue-direction-newer',
509 'older' => 'api-help-paramvalue-direction-older',
510 ],
511 ],
512 'limit' => [
513 ParamValidator::PARAM_DEFAULT => 10,
514 ParamValidator::PARAM_TYPE => 'limit',
515 IntegerDef::PARAM_MIN => 1,
516 IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
517 IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2
518 ],
519 'prop' => [
520 ParamValidator::PARAM_ISMULTI => true,
521 ParamValidator::PARAM_DEFAULT => 'ids|title|flags',
523 ParamValidator::PARAM_TYPE => [
524 'ids',
525 'title',
526 'flags',
527 'user',
528 'userid',
529 'comment',
530 'parsedcomment',
531 'timestamp',
532 'patrol',
533 'sizes',
534 'notificationtimestamp',
535 'loginfo',
536 'tags',
537 'expiry',
538 ]
539 ],
540 'show' => [
541 ParamValidator::PARAM_ISMULTI => true,
542 ParamValidator::PARAM_TYPE => [
543 WatchedItemQueryService::FILTER_MINOR,
544 WatchedItemQueryService::FILTER_NOT_MINOR,
545 WatchedItemQueryService::FILTER_BOT,
546 WatchedItemQueryService::FILTER_NOT_BOT,
547 WatchedItemQueryService::FILTER_ANON,
548 WatchedItemQueryService::FILTER_NOT_ANON,
549 WatchedItemQueryService::FILTER_PATROLLED,
550 WatchedItemQueryService::FILTER_NOT_PATROLLED,
551 WatchedItemQueryService::FILTER_AUTOPATROLLED,
552 WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED,
553 WatchedItemQueryService::FILTER_UNREAD,
554 WatchedItemQueryService::FILTER_NOT_UNREAD,
555 ]
556 ],
557 'type' => [
558 ParamValidator::PARAM_DEFAULT => 'edit|new|log|categorize',
559 ParamValidator::PARAM_ISMULTI => true,
561 ParamValidator::PARAM_TYPE => RecentChange::getChangeTypes()
562 ],
563 'owner' => [
564 ParamValidator::PARAM_TYPE => 'user',
565 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
566 ],
567 'token' => [
568 ParamValidator::PARAM_TYPE => 'string',
569 ParamValidator::PARAM_SENSITIVE => true,
570 ],
571 'continue' => [
572 ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
573 ],
574 ];
575 }
576
577 protected function getExamplesMessages() {
578 return [
579 'action=query&list=watchlist'
580 => 'apihelp-query+watchlist-example-simple',
581 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
582 => 'apihelp-query+watchlist-example-props',
583 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment|expiry'
584 => 'apihelp-query+watchlist-example-expiry',
585 'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
586 => 'apihelp-query+watchlist-example-allrev',
587 'action=query&generator=watchlist&prop=info'
588 => 'apihelp-query+watchlist-example-generator',
589 'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
590 => 'apihelp-query+watchlist-example-generator-rev',
591 'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
592 => 'apihelp-query+watchlist-example-wlowner',
593 ];
594 }
595
596 public function getHelpUrls() {
597 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
598 }
599}
getUser()
const RC_NEW
Definition Defines.php:117
const RC_LOG
Definition Defines.php:118
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
dieWithError( $msg, $code=null, $data=null, $httpCode=0)
Abort execution with an error.
Definition ApiBase.php:1454
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition ApiBase.php:1643
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition ApiBase.php:1656
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition ApiBase.php:196
const LIMIT_BIG1
Fast query, standard limit.
Definition ApiBase.php:221
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition ApiBase.php:938
getResult()
Get the result object.
Definition ApiBase.php:629
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition ApiBase.php:163
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition ApiBase.php:223
getModuleName()
Get the name of the module being executed by this instance.
Definition ApiBase.php:498
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition ApiBase.php:711
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
__construct(ApiQuery $query, $moduleName, CommentStore $commentStore, WatchedItemQueryService $watchedItemQueryService, Language $contentLanguage, NamespaceInfo $namespaceInfo, GenderCache $genderCache)
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getExamplesMessages()
Returns usage examples for this module.
getHelpUrls()
Return links to more detailed help pages about the module.
executeGenerator( $resultPageSet)
Execute this module as a generator.
This is the main query class.
Definition ApiQuery.php:41
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static isUnpatrolled( $rc, User $user)
Handle database storage of comments such as edit summaries and log reasons.
Caches user genders when needed to use correct namespace aliases.
Base class for language-specific code.
Definition Language.php:53
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition Linker.php:1449
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
const DELETED_ACTION
Definition LogPage.php:40
Type definition for user types.
Definition UserDef.php:27
Page revision base class.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
const PRC_UNPATROLLED
static parseToRCType( $type)
Parsing text to RC_* constants.
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
const PRC_AUTOPATROLLED
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition Title.php:282
static castFromPageIdentity(?PageIdentity $pageIdentity)
Return a Title for a given PageIdentity.
Definition Title.php:319
Representation of a pair of user and title for watchlist entries.
getExpiry(?int $style=TS_MW)
When the watched item will expire.
getNotificationTimestamp()
Get the notification timestamp of this entry.
Service for formatting and validating API parameters.
Type definition for integer types.