MediaWiki  master
WatchedItemStoreInterface.php
Go to the documentation of this file.
1 <?php
26 
32 
36  public const SORT_ASC = 'ASC';
37 
41  public const SORT_DESC = 'DESC';
42 
53  public function countWatchedItems( UserIdentity $user );
54 
62  public function countWatchers( $target );
63 
76  public function countVisitingWatchers( $target, $threshold );
77 
89  public function countWatchersMultiple( array $targets, array $options = [] );
90 
113  array $targetsWithVisitThresholds,
114  $minimumWatchers = null
115  );
116 
127  public function getWatchedItem( UserIdentity $user, $target );
128 
139  public function loadWatchedItem( UserIdentity $user, $target );
140 
151  public function loadWatchedItemsBatch( UserIdentity $user, array $targets );
152 
167  public function getWatchedItemsForUser( UserIdentity $user, array $options = [] );
168 
179  public function isWatched( UserIdentity $user, $target );
180 
192  public function isTempWatched( UserIdentity $user, $target ): bool;
193 
205  public function getNotificationTimestampsBatch( UserIdentity $user, array $targets );
206 
218  public function addWatch( UserIdentity $user, $target, ?string $expiry = null );
219 
231  public function addWatchBatchForUser( UserIdentity $user, array $targets, ?string $expiry = null );
232 
246  public function removeWatch( UserIdentity $user, $target );
247 
259  UserIdentity $user,
260  $timestamp,
261  array $targets = []
262  );
263 
272  public function resetAllNotificationTimestampsForUser( UserIdentity $user, $timestamp = null );
273 
286  UserIdentity $editor, $target, $timestamp );
287 
303  public function resetNotificationTimestamp(
304  UserIdentity $user, $title, $force = '', $oldid = 0 );
305 
315  public function countUnreadNotifications( UserIdentity $user, $unreadLimit = null );
316 
328  public function duplicateAllAssociatedEntries( $oldTarget, $newTarget );
329 
342  public function duplicateEntry( $oldTarget, $newTarget );
343 
351  public function clearUserWatchedItems( UserIdentity $user );
352 
362  public function mustClearWatchedItemsUsingJobQueue( UserIdentity $user ): bool;
363 
372 
379  public function maybeEnqueueWatchlistExpiryJob(): void;
380 
389  public function removeWatchBatchForUser( UserIdentity $user, array $targets );
390 
405  $timestamp, UserIdentity $user, $target );
406 
414  public function countExpired(): int;
415 
426  public function removeExpired( int $limit, bool $deleteOrphans = false ): void;
427 }
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:64
WatchedItemStoreInterface\isWatched
isWatched(UserIdentity $user, $target)
Must be called separately for Subject & Talk namespaces.
WatchedItemStoreInterface\countWatchers
countWatchers( $target)
WatchedItemStoreInterface\getNotificationTimestampsBatch
getNotificationTimestampsBatch(UserIdentity $user, array $targets)
WatchedItemStoreInterface\loadWatchedItemsBatch
loadWatchedItemsBatch(UserIdentity $user, array $targets)
Loads a set of WatchedItems from the db.
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\getWatchedItem
getWatchedItem(UserIdentity $user, $target)
Get an item (may be cached)
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:39
WatchedItemStoreInterface\getWatchedItemsForUser
getWatchedItemsForUser(UserIdentity $user, array $options=[])
WatchedItemStoreInterface\removeExpired
removeExpired(int $limit, bool $deleteOrphans=false)
Remove some number of expired watchlist items.
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:41
WatchedItemStoreInterface\resetNotificationTimestamp
resetNotificationTimestamp(UserIdentity $user, $title, $force='', $oldid=0)
Reset the notification timestamp of this entry.
$title
$title
Definition: testCompression.php:38
WatchedItemStoreInterface\countVisitingWatchers
countVisitingWatchers( $target, $threshold)
Number of page watchers who also visited a "recent" edit.
WatchedItemStoreInterface\duplicateEntry
duplicateEntry( $oldTarget, $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
WatchedItemStoreInterface\getLatestNotificationTimestamp
getLatestNotificationTimestamp( $timestamp, UserIdentity $user, $target)
Convert $timestamp to TS_MW or return null if the page was visited since then by $user.
WatchedItemStoreInterface\setNotificationTimestampsForUser
setNotificationTimestampsForUser(UserIdentity $user, $timestamp, array $targets=[])
WatchedItemStoreInterface\SORT_ASC
const SORT_ASC
Definition: WatchedItemStoreInterface.php:36
Wikimedia\Rdbms\DBUnexpectedError
@newable
Definition: DBUnexpectedError.php:29
WatchedItemStoreInterface\removeWatchBatchForUser
removeWatchBatchForUser(UserIdentity $user, array $targets)
WatchedItemStoreInterface\loadWatchedItem
loadWatchedItem(UserIdentity $user, $target)
Loads an item from the db.
WatchedItemStoreInterface\isTempWatched
isTempWatched(UserIdentity $user, $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\addWatch
addWatch(UserIdentity $user, $target, ?string $expiry=null)
Must be called separately for Subject & Talk namespaces.
WatchedItemStoreInterface\maybeEnqueueWatchlistExpiryJob
maybeEnqueueWatchlistExpiryJob()
Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled,...
WatchedItemStoreInterface\countWatchedItems
countWatchedItems(UserIdentity $user)
Count the number of individual items that are watched by the user.
WatchedItemStoreInterface\removeWatch
removeWatch(UserIdentity $user, $target)
Removes an entry for the UserIdentity watching the target (LinkTarget or PageIdentity) Must be called...
WatchedItemStoreInterface\clearUserWatchedItems
clearUserWatchedItems(UserIdentity $user)
Synchronously clear the users watchlist.
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:31
WatchedItemStoreInterface\duplicateAllAssociatedEntries
duplicateAllAssociatedEntries( $oldTarget, $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
WatchedItemStoreInterface\updateNotificationTimestamp
updateNotificationTimestamp(UserIdentity $editor, $target, $timestamp)
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.