MediaWiki  master
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
28 
36 
38  private $commentStore;
39 
42 
45 
47  private $namespaceInfo;
48 
50  private $genderCache;
51 
61  public function __construct(
62  ApiQuery $query,
63  $moduleName,
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,
91 
93  private $fld_expiry = false;
94 
99  private function run( $resultPageSet = null ) {
100  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
101 
102  $params = $this->extractRequestParams();
103 
104  $user = $this->getUser();
105  $wlowner = $this->getWatchlistUser( $params );
106 
107  if ( $params['prop'] !== null && $resultPageSet === null ) {
108  $prop = array_fill_keys( $params['prop'], true );
109 
110  $this->fld_ids = isset( $prop['ids'] );
111  $this->fld_title = isset( $prop['title'] );
112  $this->fld_flags = isset( $prop['flags'] );
113  $this->fld_user = isset( $prop['user'] );
114  $this->fld_userid = isset( $prop['userid'] );
115  $this->fld_comment = isset( $prop['comment'] );
116  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
117  $this->fld_timestamp = isset( $prop['timestamp'] );
118  $this->fld_sizes = isset( $prop['sizes'] );
119  $this->fld_patrol = isset( $prop['patrol'] );
120  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
121  $this->fld_loginfo = isset( $prop['loginfo'] );
122  $this->fld_tags = isset( $prop['tags'] );
123  $this->fld_expiry = isset( $prop['expiry'] );
124 
125  if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
126  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
127  }
128  }
129 
130  $options = [
131  'dir' => $params['dir'] === 'older'
134  ];
135 
136  if ( $resultPageSet === null ) {
137  $options['includeFields'] = $this->getFieldsToInclude();
138  } else {
139  $options['usedInGenerator'] = true;
140  }
141 
142  if ( $params['start'] ) {
143  $options['start'] = $params['start'];
144  }
145  if ( $params['end'] ) {
146  $options['end'] = $params['end'];
147  }
148 
149  $startFrom = null;
150  if ( $params['continue'] !== null ) {
151  $cont = explode( '|', $params['continue'] );
152  $this->dieContinueUsageIf( count( $cont ) != 2 );
153  $continueTimestamp = $cont[0];
154  $continueId = (int)$cont[1];
155  $this->dieContinueUsageIf( $continueId != $cont[1] );
156  $startFrom = [ $continueTimestamp, $continueId ];
157  }
158 
159  if ( $wlowner !== $user ) {
160  $options['watchlistOwner'] = $wlowner;
161  $options['watchlistOwnerToken'] = $params['token'];
162  }
163 
164  if ( $params['namespace'] !== null ) {
165  $options['namespaceIds'] = $params['namespace'];
166  }
167 
168  if ( $params['allrev'] ) {
169  $options['allRevisions'] = true;
170  }
171 
172  if ( $params['show'] !== null ) {
173  $show = array_fill_keys( $params['show'], true );
174 
175  /* Check for conflicting parameters. */
176  if ( $this->showParamsConflicting( $show ) ) {
177  $this->dieWithError( 'apierror-show' );
178  }
179 
180  // Check permissions.
181  if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
183  ) {
184  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
185  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
186  }
187  }
188 
189  $options['filters'] = array_keys( $show );
190  }
191 
192  if ( $params['type'] !== null ) {
193  try {
194  $rcTypes = RecentChange::parseToRCType( $params['type'] );
195  if ( $rcTypes ) {
196  $options['rcTypes'] = $rcTypes;
197  }
198  } catch ( Exception $e ) {
199  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
200  }
201  }
202 
203  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
204  if ( $params['user'] !== null ) {
205  $options['onlyByUser'] = $params['user'];
206  }
207  if ( $params['excludeuser'] !== null ) {
208  $options['notByUser'] = $params['excludeuser'];
209  }
210 
211  $options['limit'] = $params['limit'];
212 
213  $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
214  $this, $params, $options );
215 
216  $ids = [];
217  $items = $this->watchedItemQueryService->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
218 
219  // Get gender information
220  if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
221  $this->contentLanguage->needsGenderDistinction()
222  ) {
223  $usernames = [];
224  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
226  $linkTarget = $watchedItem->getTarget();
227  if ( $this->namespaceInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
228  $usernames[] = $linkTarget->getText();
229  }
230  }
231  if ( $usernames !== [] ) {
232  $this->genderCache->doQuery( $usernames, __METHOD__ );
233  }
234  }
235 
236  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
238  if ( $resultPageSet === null ) {
239  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
240  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
241  if ( !$fit ) {
242  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
243  break;
244  }
245  } elseif ( $params['allrev'] ) {
246  $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
247  } else {
248  $ids[] = (int)$recentChangeInfo['rc_cur_id'];
249  }
250  }
251 
252  if ( $startFrom !== null ) {
253  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
254  }
255 
256  if ( $resultPageSet === null ) {
257  $this->getResult()->addIndexedTagName(
258  [ 'query', $this->getModuleName() ],
259  'item'
260  );
261  } elseif ( $params['allrev'] ) {
262  $resultPageSet->populateFromRevisionIDs( $ids );
263  } else {
264  $resultPageSet->populateFromPageIDs( $ids );
265  }
266  }
267 
268  private function getFieldsToInclude() {
269  $includeFields = [];
270  if ( $this->fld_flags ) {
271  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
272  }
273  if ( $this->fld_user || $this->fld_userid || $this->fld_loginfo ) {
274  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
275  }
276  if ( $this->fld_user || $this->fld_loginfo ) {
277  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
278  }
279  if ( $this->fld_comment || $this->fld_parsedcomment ) {
280  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
281  }
282  if ( $this->fld_patrol ) {
285  }
286  if ( $this->fld_sizes ) {
287  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
288  }
289  if ( $this->fld_loginfo ) {
291  }
292  if ( $this->fld_tags ) {
293  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
294  }
295  return $includeFields;
296  }
297 
298  private function showParamsConflicting( array $show ) {
299  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
300  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
301  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
302  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
303  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
304  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
305  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
311  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
312  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
313  }
314 
315  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
316  /* Determine the title of the page that has been changed. */
317  $target = $watchedItem->getTarget();
318  if ( $target instanceof LinkTarget ) {
319  $title = Title::newFromLinkTarget( $target );
320  } else {
321  $title = Title::castFromPageIdentity( $target );
322  }
323  $user = $this->getUser();
324 
325  /* Our output data. */
326  $vals = [];
327  $type = (int)$recentChangeInfo['rc_type'];
328  $vals['type'] = RecentChange::parseFromRCType( $type );
329  $anyHidden = false;
330 
331  /* Create a new entry in the result for the title. */
332  if ( $this->fld_title || $this->fld_ids ) {
333  // These should already have been filtered out of the query, but just in case.
334  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
335  $vals['actionhidden'] = true;
336  $anyHidden = true;
337  }
338  if ( $type !== RC_LOG ||
340  $recentChangeInfo['rc_deleted'],
342  $user
343  )
344  ) {
345  if ( $this->fld_title ) {
346  // @phan-suppress-next-line PhanTypeMismatchArgumentNullable castFrom does not return null here
348  }
349  if ( $this->fld_ids ) {
350  $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
351  $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
352  $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
353  }
354  }
355  }
356 
357  /* Add user data and 'anon' flag, if user is anonymous. */
358  if ( $this->fld_user || $this->fld_userid ) {
359  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
360  $vals['userhidden'] = true;
361  $anyHidden = true;
362  }
363  if ( RevisionRecord::userCanBitfield(
364  $recentChangeInfo['rc_deleted'],
365  RevisionRecord::DELETED_USER,
366  $user
367  ) ) {
368  if ( $this->fld_userid ) {
369  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
370  // for backwards compatibility
371  $vals['user'] = (int)$recentChangeInfo['rc_user'];
372  }
373 
374  if ( $this->fld_user ) {
375  $vals['user'] = $recentChangeInfo['rc_user_text'];
376  }
377 
378  $vals['anon'] = !$recentChangeInfo['rc_user'];
379  }
380  }
381 
382  /* Add flags, such as new, minor, bot. */
383  if ( $this->fld_flags ) {
384  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
385  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
386  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
387  }
388 
389  /* Add sizes of each revision. (Only available on 1.10+) */
390  if ( $this->fld_sizes ) {
391  $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
392  $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
393  }
394 
395  /* Add the timestamp. */
396  if ( $this->fld_timestamp ) {
397  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
398  }
399 
400  if ( $this->fld_notificationtimestamp ) {
401  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
402  ? ''
403  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
404  }
405 
406  /* Add edit summary / log summary. */
407  if ( $this->fld_comment || $this->fld_parsedcomment ) {
408  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
409  $vals['commenthidden'] = true;
410  $anyHidden = true;
411  }
412  if ( RevisionRecord::userCanBitfield(
413  $recentChangeInfo['rc_deleted'],
414  RevisionRecord::DELETED_COMMENT,
415  $user
416  ) ) {
417  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
418  if ( $this->fld_comment ) {
419  $vals['comment'] = $comment;
420  }
421 
422  if ( $this->fld_parsedcomment ) {
423  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
424  }
425  }
426  }
427 
428  /* Add the patrolled flag */
429  if ( $this->fld_patrol ) {
430  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
431  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
432  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
433  }
434 
435  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
436  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
437  $vals['actionhidden'] = true;
438  $anyHidden = true;
439  }
441  $recentChangeInfo['rc_deleted'],
443  $user
444  ) ) {
445  $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
446  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
447  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
448 
449  $logFormatter = LogFormatter::newFromRow( $recentChangeInfo );
450  $vals['logparams'] = $logFormatter->formatParametersForApi();
451  $vals['logdisplay'] = $logFormatter->getActionText();
452  }
453  }
454 
455  if ( $this->fld_tags ) {
456  if ( $recentChangeInfo['rc_tags'] ) {
457  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
458  ApiResult::setIndexedTagName( $tags, 'tag' );
459  $vals['tags'] = $tags;
460  } else {
461  $vals['tags'] = [];
462  }
463  }
464 
465  if ( $this->fld_expiry ) {
466  // Add expiration, T263796
467  $expiry = $watchedItem->getExpiry( TS_ISO_8601 );
468  $vals['expiry'] = ( $expiry ?? false );
469  }
470 
471  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
472  $vals['suppressed'] = true;
473  }
474 
475  $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
476  $this, $watchedItem, $recentChangeInfo, $vals );
477 
478  return $vals;
479  }
480 
481  public function getAllowedParams() {
482  return [
483  'allrev' => false,
484  'start' => [
485  ParamValidator::PARAM_TYPE => 'timestamp'
486  ],
487  'end' => [
488  ParamValidator::PARAM_TYPE => 'timestamp'
489  ],
490  'namespace' => [
491  ParamValidator::PARAM_ISMULTI => true,
492  ParamValidator::PARAM_TYPE => 'namespace'
493  ],
494  'user' => [
495  ParamValidator::PARAM_TYPE => 'user',
496  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
497  ],
498  'excludeuser' => [
499  ParamValidator::PARAM_TYPE => 'user',
500  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
501  ],
502  'dir' => [
503  ParamValidator::PARAM_DEFAULT => 'older',
504  ParamValidator::PARAM_TYPE => [
505  'newer',
506  'older'
507  ],
508  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
509  ],
510  'limit' => [
511  ParamValidator::PARAM_DEFAULT => 10,
512  ParamValidator::PARAM_TYPE => 'limit',
513  IntegerDef::PARAM_MIN => 1,
514  IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
515  IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2
516  ],
517  'prop' => [
518  ParamValidator::PARAM_ISMULTI => true,
519  ParamValidator::PARAM_DEFAULT => 'ids|title|flags',
521  ParamValidator::PARAM_TYPE => [
522  'ids',
523  'title',
524  'flags',
525  'user',
526  'userid',
527  'comment',
528  'parsedcomment',
529  'timestamp',
530  'patrol',
531  'sizes',
532  'notificationtimestamp',
533  'loginfo',
534  'tags',
535  'expiry',
536  ]
537  ],
538  'show' => [
539  ParamValidator::PARAM_ISMULTI => true,
540  ParamValidator::PARAM_TYPE => [
553  ]
554  ],
555  'type' => [
556  ParamValidator::PARAM_DEFAULT => 'edit|new|log|categorize',
557  ParamValidator::PARAM_ISMULTI => true,
559  ParamValidator::PARAM_TYPE => RecentChange::getChangeTypes()
560  ],
561  'owner' => [
562  ParamValidator::PARAM_TYPE => 'user',
563  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
564  ],
565  'token' => [
566  ParamValidator::PARAM_TYPE => 'string',
567  ParamValidator::PARAM_SENSITIVE => true,
568  ],
569  'continue' => [
570  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
571  ],
572  ];
573  }
574 
575  protected function getExamplesMessages() {
576  return [
577  'action=query&list=watchlist'
578  => 'apihelp-query+watchlist-example-simple',
579  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
580  => 'apihelp-query+watchlist-example-props',
581  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment|expiry'
582  => 'apihelp-query+watchlist-example-expiry',
583  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
584  => 'apihelp-query+watchlist-example-allrev',
585  'action=query&generator=watchlist&prop=info'
586  => 'apihelp-query+watchlist-example-generator',
587  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
588  => 'apihelp-query+watchlist-example-generator-rev',
589  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
590  => 'apihelp-query+watchlist-example-wlowner',
591  ];
592  }
593 
594  public function getHelpUrls() {
595  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
596  }
597 }
const RC_NEW
Definition: Defines.php:116
const RC_LOG
Definition: Defines.php:117
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1458
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:1187
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1650
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1663
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
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:765
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
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
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)
run( $resultPageSet=null)
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
showParamsConflicting(array $show)
CommentStore $commentStore
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
NamespaceInfo $namespaceInfo
getExamplesMessages()
Returns usage examples for this module.
GenderCache $genderCache
getHelpUrls()
Return links to more detailed help pages about the module.
executeGenerator( $resultPageSet)
Execute this module as a generator.
WatchedItemQueryService $watchedItemQueryService
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.
Definition: ApiResult.php:604
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.
Definition: GenderCache.php:36
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: Language.php:45
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:1402
static userCanBitfield( $bitfield, $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this log row,...
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
const DELETED_ACTION
Definition: LogPage.php:40
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 getChangeTypes()
Get an array of all change types.
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.
Definition: WatchedItem.php:36
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.
Definition: IntegerDef.php:23
const DB_REPLICA
Definition: defines.php:26