MediaWiki master
WatchedItemStoreInterface.php
Go to the documentation of this file.
1<?php
25
31
35 public const SORT_ASC = 'ASC';
36
40 public const SORT_DESC = 'DESC';
41
52 public function countWatchedItems( UserIdentity $user );
53
61 public function countWatchers( $target );
62
73 public function countVisitingWatchers( $target, $threshold );
74
86 public function countWatchersMultiple( array $targets, array $options = [] );
87
110 array $targetsWithVisitThresholds,
111 $minimumWatchers = null
112 );
113
124 public function getWatchedItem( UserIdentity $user, $target );
125
136 public function loadWatchedItem( UserIdentity $user, $target );
137
148 public function loadWatchedItemsBatch( UserIdentity $user, array $targets );
149
164 public function getWatchedItemsForUser( UserIdentity $user, array $options = [] );
165
176 public function isWatched( UserIdentity $user, $target );
177
189 public function isTempWatched( UserIdentity $user, $target ): bool;
190
202 public function getNotificationTimestampsBatch( UserIdentity $user, array $targets );
203
215 public function addWatch( UserIdentity $user, $target, ?string $expiry = null );
216
228 public function addWatchBatchForUser( UserIdentity $user, array $targets, ?string $expiry = null );
229
241 public function removeWatch( UserIdentity $user, $target );
242
254 UserIdentity $user,
255 $timestamp,
256 array $targets = []
257 );
258
267 public function resetAllNotificationTimestampsForUser( UserIdentity $user, $timestamp = null );
268
281 UserIdentity $editor, $target, $timestamp );
282
299 UserIdentity $user, $title, $force = '', $oldid = 0 );
300
310 public function countUnreadNotifications( UserIdentity $user, $unreadLimit = null );
311
323 public function duplicateAllAssociatedEntries( $oldTarget, $newTarget );
324
337 public function duplicateEntry( $oldTarget, $newTarget );
338
348 public function clearUserWatchedItems( UserIdentity $user );
349
359 public function mustClearWatchedItemsUsingJobQueue( UserIdentity $user ): bool;
360
369
376 public function maybeEnqueueWatchlistExpiryJob(): void;
377
386 public function removeWatchBatchForUser( UserIdentity $user, array $targets );
387
402 $timestamp, UserIdentity $user, $target );
403
411 public function countExpired(): int;
412
423 public function removeExpired( int $limit, bool $deleteOrphans = false ): void;
424}
Represents the target of a wiki link.
Interface for objects (potentially) representing an editable wiki page.
Interface for objects representing user identity.
isTempWatched(UserIdentity $user, $target)
Whether the page is only being watched temporarily (has expiry).
countWatchersMultiple(array $targets, array $options=[])
getWatchedItem(UserIdentity $user, $target)
Get an item (may be cached)
loadWatchedItem(UserIdentity $user, $target)
Loads an item from the db.
removeWatchBatchForUser(UserIdentity $user, array $targets)
maybeEnqueueWatchlistExpiryJob()
Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled,...
removeExpired(int $limit, bool $deleteOrphans=false)
Remove some number of expired watchlist items.
countVisitingWatchersMultiple(array $targetsWithVisitThresholds, $minimumWatchers=null)
Number of watchers of each page who have visited recent edits to that page.
getWatchedItemsForUser(UserIdentity $user, array $options=[])
countExpired()
Get the number of watchlist items that expire before the current time.
countUnreadNotifications(UserIdentity $user, $unreadLimit=null)
clearUserWatchedItemsUsingJobQueue(UserIdentity $user)
Queues a job that will clear the users watchlist using the Job Queue.
addWatchBatchForUser(UserIdentity $user, array $targets, ?string $expiry=null)
addWatch(UserIdentity $user, $target, ?string $expiry=null)
Must be called separately for Subject & Talk namespaces.
resetNotificationTimestamp(UserIdentity $user, $title, $force='', $oldid=0)
Reset the notification timestamp of this entry.
countWatchedItems(UserIdentity $user)
Count the number of individual items that are watched by the user.
clearUserWatchedItems(UserIdentity $user)
Synchronously clear the users watchlist.
isWatched(UserIdentity $user, $target)
Must be called separately for Subject & Talk namespaces.
countVisitingWatchers( $target, $threshold)
Number of page watchers who also visited a "recent" edit.
mustClearWatchedItemsUsingJobQueue(UserIdentity $user)
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead ...
loadWatchedItemsBatch(UserIdentity $user, array $targets)
Loads a set of WatchedItems from the db.
duplicateEntry( $oldTarget, $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
updateNotificationTimestamp(UserIdentity $editor, $target, $timestamp)
duplicateAllAssociatedEntries( $oldTarget, $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
removeWatch(UserIdentity $user, $target)
Removes an entry for the UserIdentity watching the target (LinkTarget or PageIdentity) Must be called...
setNotificationTimestampsForUser(UserIdentity $user, $timestamp, array $targets=[])
getNotificationTimestampsBatch(UserIdentity $user, array $targets)
getLatestNotificationTimestamp( $timestamp, UserIdentity $user, $target)
Convert $timestamp to TS_MW or return null if the page was visited since then by $user.
resetAllNotificationTimestampsForUser(UserIdentity $user, $timestamp=null)
Reset all watchlist notification timestamps for a user using the job queue.