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( LinkTarget $target );
62 
75  public function countVisitingWatchers( LinkTarget $target, $threshold );
76 
88  public function countWatchersMultiple( array $targets, array $options = [] );
89 
111  array $targetsWithVisitThresholds,
112  $minimumWatchers = null
113  );
114 
125  public function getWatchedItem( UserIdentity $user, LinkTarget $target );
126 
137  public function loadWatchedItem( UserIdentity $user, LinkTarget $target );
138 
153  public function getWatchedItemsForUser( UserIdentity $user, array $options = [] );
154 
165  public function isWatched( UserIdentity $user, LinkTarget $target );
166 
178  public function isTempWatched( UserIdentity $user, LinkTarget $target ): bool;
179 
191  public function getNotificationTimestampsBatch( UserIdentity $user, array $targets );
192 
204  public function addWatch( UserIdentity $user, LinkTarget $target, ?string $expiry = null );
205 
217  public function addWatchBatchForUser( UserIdentity $user, array $targets, ?string $expiry = null );
218 
232  public function removeWatch( UserIdentity $user, LinkTarget $target );
233 
244  UserIdentity $user,
245  $timestamp,
246  array $targets = []
247  );
248 
257  public function resetAllNotificationTimestampsForUser( UserIdentity $user, $timestamp = null );
258 
270  UserIdentity $editor, LinkTarget $target, $timestamp );
271 
287  public function resetNotificationTimestamp(
288  UserIdentity $user, LinkTarget $title, $force = '', $oldid = 0 );
289 
299  public function countUnreadNotifications( UserIdentity $user, $unreadLimit = null );
300 
312  public function duplicateAllAssociatedEntries( LinkTarget $oldTarget, LinkTarget $newTarget );
313 
326  public function duplicateEntry( LinkTarget $oldTarget, LinkTarget $newTarget );
327 
335  public function clearUserWatchedItems( UserIdentity $user );
336 
346  public function mustClearWatchedItemsUsingJobQueue( UserIdentity $user ): bool;
347 
356 
364  public function enqueueWatchlistExpiryJob( float $watchlistPurgeRate ): void;
365 
374  public function removeWatchBatchForUser( UserIdentity $user, array $targets );
375 
390  $timestamp, UserIdentity $user, LinkTarget $target );
391 
399  public function countExpired(): int;
400 
411  public function removeExpired( int $limit, bool $deleteOrphans = false ): void;
412 }
WatchedItemStoreInterface\getNotificationTimestampsBatch
getNotificationTimestampsBatch(UserIdentity $user, array $targets)
WatchedItemStoreInterface\countWatchersMultiple
countWatchersMultiple(array $targets, array $options=[])
WatchedItemStoreInterface\addWatchBatchForUser
addWatchBatchForUser(UserIdentity $user, array $targets, ?string $expiry=null)
WatchedItemStoreInterface\countUnreadNotifications
countUnreadNotifications(UserIdentity $user, $unreadLimit=null)
WatchedItemStoreInterface\clearUserWatchedItemsUsingJobQueue
clearUserWatchedItemsUsingJobQueue(UserIdentity $user)
Queues a job that will clear the users watchlist using the Job Queue.
WatchedItemStoreInterface\updateNotificationTimestamp
updateNotificationTimestamp(UserIdentity $editor, LinkTarget $target, $timestamp)
WatchedItemStoreInterface\duplicateEntry
duplicateEntry(LinkTarget $oldTarget, LinkTarget $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
WatchedItemStoreInterface\duplicateAllAssociatedEntries
duplicateAllAssociatedEntries(LinkTarget $oldTarget, LinkTarget $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:32
WatchedItemStoreInterface\getLatestNotificationTimestamp
getLatestNotificationTimestamp( $timestamp, UserIdentity $user, LinkTarget $target)
Convert $timestamp to TS_MW or return null if the page was visited since then by $user.
WatchedItemStoreInterface\getWatchedItemsForUser
getWatchedItemsForUser(UserIdentity $user, array $options=[])
WatchedItemStoreInterface\removeExpired
removeExpired(int $limit, bool $deleteOrphans=false)
Remove some number of expired watchlist items.
WatchedItemStoreInterface\countVisitingWatchers
countVisitingWatchers(LinkTarget $target, $threshold)
Number of page watchers who also visited a "recent" edit.
WatchedItemStoreInterface\countWatchers
countWatchers(LinkTarget $target)
WatchedItemStoreInterface\resetNotificationTimestamp
resetNotificationTimestamp(UserIdentity $user, LinkTarget $title, $force='', $oldid=0)
Reset the notification timestamp of this entry.
WatchedItemStoreInterface\countVisitingWatchersMultiple
countVisitingWatchersMultiple(array $targetsWithVisitThresholds, $minimumWatchers=null)
Number of watchers of each page who have visited recent edits to that page.
WatchedItemStoreInterface\SORT_DESC
const SORT_DESC
Definition: WatchedItemStoreInterface.php:40
WatchedItemStoreInterface\isWatched
isWatched(UserIdentity $user, LinkTarget $target)
Must be called separately for Subject & Talk namespaces.
$title
$title
Definition: testCompression.php:38
WatchedItemStoreInterface\getWatchedItem
getWatchedItem(UserIdentity $user, LinkTarget $target)
Get an item (may be cached)
WatchedItemStoreInterface\loadWatchedItem
loadWatchedItem(UserIdentity $user, LinkTarget $target)
Loads an item from the db.
WatchedItemStoreInterface\setNotificationTimestampsForUser
setNotificationTimestampsForUser(UserIdentity $user, $timestamp, array $targets=[])
WatchedItemStoreInterface\SORT_ASC
const SORT_ASC
Definition: WatchedItemStoreInterface.php:35
Wikimedia\Rdbms\DBUnexpectedError
@newable Stable to extend
Definition: DBUnexpectedError.php:29
WatchedItemStoreInterface\removeWatchBatchForUser
removeWatchBatchForUser(UserIdentity $user, array $targets)
WatchedItemStoreInterface\enqueueWatchlistExpiryJob
enqueueWatchlistExpiryJob(float $watchlistPurgeRate)
Probabilistically add a job to purge the expired watchlist items.
WatchedItemStoreInterface\isTempWatched
isTempWatched(UserIdentity $user, LinkTarget $target)
Whether the page is only being watched temporarily (has expiry).
WatchedItemStoreInterface\resetAllNotificationTimestampsForUser
resetAllNotificationTimestampsForUser(UserIdentity $user, $timestamp=null)
Reset all watchlist notificaton timestamps for a user using the job queue.
WatchedItemStoreInterface\countWatchedItems
countWatchedItems(UserIdentity $user)
Count the number of individual items that are watched by the user.
WatchedItemStoreInterface\clearUserWatchedItems
clearUserWatchedItems(UserIdentity $user)
Synchronously clear the users watchlist.
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
WatchedItemStoreInterface\addWatch
addWatch(UserIdentity $user, LinkTarget $target, ?string $expiry=null)
Must be called separately for Subject & Talk namespaces.
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:30
WatchedItemStoreInterface\removeWatch
removeWatch(UserIdentity $user, LinkTarget $target)
Removes an entry for the UserIdentity watching the LinkTarget Must be called separately for Subject &...
WatchedItemStoreInterface\mustClearWatchedItemsUsingJobQueue
mustClearWatchedItemsUsingJobQueue(UserIdentity $user)
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead ...
WatchedItemStoreInterface\countExpired
countExpired()
Get the number of watchlist items that expire before the current time.