MediaWiki
master
WatchedItemStoreInterface.php
Go to the documentation of this file.
1
<?php
8
namespace
MediaWiki\Watchlist
;
9
10
use
MediaWiki\Page\PageReference
;
11
use
MediaWiki\User\UserIdentity
;
12
17
interface
WatchedItemStoreInterface
{
18
22
public
const
SORT_ASC
=
'ASC'
;
23
27
public
const
SORT_DESC
=
'DESC'
;
28
39
public
function
countWatchedItems
(
UserIdentity
$user );
40
48
public
function
countWatchers
(
PageReference
$target );
49
60
public
function
countVisitingWatchers
(
PageReference
$target, $threshold );
61
73
public
function
countWatchersMultiple
( array $targets, array $options = [] );
74
93
public
function
countVisitingWatchersMultiple
(
94
array $targetsWithVisitThresholds,
95
$minimumWatchers =
null
96
);
97
108
public
function
getWatchedItem
(
UserIdentity
$user,
PageReference
$target );
109
120
public
function
loadWatchedItem
(
UserIdentity
$user,
PageReference
$target );
121
132
public
function
loadWatchedItemsBatch
(
UserIdentity
$user, array $targets );
133
147
public
function
getWatchedItemsForUser
(
UserIdentity
$user, array $options = [] );
148
159
public
function
isWatched
(
UserIdentity
$user,
PageReference
$target );
160
172
public
function
isTempWatched
(
UserIdentity
$user,
PageReference
$target ): bool;
173
185
public
function
getNotificationTimestampsBatch
(
UserIdentity
$user, array $targets );
186
198
public
function
addWatch
(
UserIdentity
$user,
PageReference
$target, ?
string
$expiry =
null
);
199
211
public
function
addWatchBatchForUser
(
UserIdentity
$user, array $targets, ?
string
$expiry =
null
);
212
224
public
function
removeWatch
(
UserIdentity
$user,
PageReference
$target );
225
235
public
function
setNotificationTimestampsForUser
(
236
UserIdentity
$user,
237
$timestamp,
238
array $targets = []
239
);
240
249
public
function
resetAllNotificationTimestampsForUser
(
UserIdentity
$user, $timestamp =
null
);
250
261
public
function
updateNotificationTimestamp
(
262
UserIdentity
$editor,
PageReference
$target, $timestamp );
263
279
public
function
resetNotificationTimestamp
(
280
UserIdentity
$user,
PageReference
$title, $force =
''
, $oldid = 0 );
281
291
public
function
countUnreadNotifications
(
UserIdentity
$user, $unreadLimit =
null
);
292
304
public
function
duplicateAllAssociatedEntries
(
PageReference
$oldTarget,
PageReference
$newTarget );
305
318
public
function
duplicateEntry
(
PageReference
$oldTarget,
PageReference
$newTarget );
319
329
public
function
clearUserWatchedItems
(
UserIdentity
$user );
330
340
public
function
mustClearWatchedItemsUsingJobQueue
(
UserIdentity
$user ): bool;
341
349
public
function
clearUserWatchedItemsUsingJobQueue
(
UserIdentity
$user );
350
357
public
function
maybeEnqueueWatchlistExpiryJob
(): void;
358
367
public
function
removeWatchBatchForUser
(
UserIdentity
$user, array $targets );
368
382
public
function
getLatestNotificationTimestamp
(
383
$timestamp,
UserIdentity
$user,
PageReference
$target );
384
392
public
function
countExpired
(): int;
393
404
public
function
removeExpired
(
int
$limit,
bool
$deleteOrphans =
false
): void;
405
415
public
function
addLabels
(
UserIdentity
$user, array $targets, array $labels ): void;
416
426
public
function
removeLabels
(
UserIdentity
$user, array $targets, array $labels ): void;
427
}
429
class_alias( WatchedItemStoreInterface::class,
'WatchedItemStoreInterface'
);
MediaWiki\Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition
PageReference.php:38
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:24
MediaWiki\Watchlist\WatchedItemStoreInterface
Definition
WatchedItemStoreInterface.php:17
MediaWiki\Watchlist\WatchedItemStoreInterface\duplicateAllAssociatedEntries
duplicateAllAssociatedEntries(PageReference $oldTarget, PageReference $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
MediaWiki\Watchlist\WatchedItemStoreInterface\addLabels
addLabels(UserIdentity $user, array $targets, array $labels)
Add a labels to a set of watchlist items.
MediaWiki\Watchlist\WatchedItemStoreInterface\getWatchedItemsForUser
getWatchedItemsForUser(UserIdentity $user, array $options=[])
MediaWiki\Watchlist\WatchedItemStoreInterface\addWatch
addWatch(UserIdentity $user, PageReference $target, ?string $expiry=null)
Must be called separately for Subject & Talk namespaces.
MediaWiki\Watchlist\WatchedItemStoreInterface\duplicateEntry
duplicateEntry(PageReference $oldTarget, PageReference $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title.
MediaWiki\Watchlist\WatchedItemStoreInterface\removeWatchBatchForUser
removeWatchBatchForUser(UserIdentity $user, array $targets)
MediaWiki\Watchlist\WatchedItemStoreInterface\getLatestNotificationTimestamp
getLatestNotificationTimestamp( $timestamp, UserIdentity $user, PageReference $target)
Convert $timestamp to TS::MW or return null if the page was visited since then by $user.
MediaWiki\Watchlist\WatchedItemStoreInterface\SORT_DESC
const SORT_DESC
Definition
WatchedItemStoreInterface.php:27
MediaWiki\Watchlist\WatchedItemStoreInterface\countWatchersMultiple
countWatchersMultiple(array $targets, array $options=[])
MediaWiki\Watchlist\WatchedItemStoreInterface\countVisitingWatchers
countVisitingWatchers(PageReference $target, $threshold)
Number of page watchers who also visited a "recent" edit.
MediaWiki\Watchlist\WatchedItemStoreInterface\getNotificationTimestampsBatch
getNotificationTimestampsBatch(UserIdentity $user, array $targets)
MediaWiki\Watchlist\WatchedItemStoreInterface\SORT_ASC
const SORT_ASC
Definition
WatchedItemStoreInterface.php:22
MediaWiki\Watchlist\WatchedItemStoreInterface\addWatchBatchForUser
addWatchBatchForUser(UserIdentity $user, array $targets, ?string $expiry=null)
MediaWiki\Watchlist\WatchedItemStoreInterface\countExpired
countExpired()
Get the number of watchlist items that expire before the current time.
MediaWiki\Watchlist\WatchedItemStoreInterface\countWatchedItems
countWatchedItems(UserIdentity $user)
Count the number of individual items that are watched by the user.
MediaWiki\Watchlist\WatchedItemStoreInterface\setNotificationTimestampsForUser
setNotificationTimestampsForUser(UserIdentity $user, $timestamp, array $targets=[])
MediaWiki\Watchlist\WatchedItemStoreInterface\countWatchers
countWatchers(PageReference $target)
MediaWiki\Watchlist\WatchedItemStoreInterface\resetAllNotificationTimestampsForUser
resetAllNotificationTimestampsForUser(UserIdentity $user, $timestamp=null)
Reset all watchlist notification timestamps for a user using the job queue.
MediaWiki\Watchlist\WatchedItemStoreInterface\mustClearWatchedItemsUsingJobQueue
mustClearWatchedItemsUsingJobQueue(UserIdentity $user)
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead ...
MediaWiki\Watchlist\WatchedItemStoreInterface\countVisitingWatchersMultiple
countVisitingWatchersMultiple(array $targetsWithVisitThresholds, $minimumWatchers=null)
Number of watchers of each page who have visited recent edits to that page.
MediaWiki\Watchlist\WatchedItemStoreInterface\clearUserWatchedItems
clearUserWatchedItems(UserIdentity $user)
Synchronously clear the users watchlist.
MediaWiki\Watchlist\WatchedItemStoreInterface\removeWatch
removeWatch(UserIdentity $user, PageReference $target)
Removes an entry for the UserIdentity watching the target Must be called separately for Subject & Tal...
MediaWiki\Watchlist\WatchedItemStoreInterface\loadWatchedItem
loadWatchedItem(UserIdentity $user, PageReference $target)
Loads an item from the db.
MediaWiki\Watchlist\WatchedItemStoreInterface\loadWatchedItemsBatch
loadWatchedItemsBatch(UserIdentity $user, array $targets)
Loads a set of WatchedItems from the db.
MediaWiki\Watchlist\WatchedItemStoreInterface\resetNotificationTimestamp
resetNotificationTimestamp(UserIdentity $user, PageReference $title, $force='', $oldid=0)
Reset the notification timestamp of this entry.
MediaWiki\Watchlist\WatchedItemStoreInterface\isTempWatched
isTempWatched(UserIdentity $user, PageReference $target)
Whether the page is only being watched temporarily (has expiry).
MediaWiki\Watchlist\WatchedItemStoreInterface\updateNotificationTimestamp
updateNotificationTimestamp(UserIdentity $editor, PageReference $target, $timestamp)
MediaWiki\Watchlist\WatchedItemStoreInterface\isWatched
isWatched(UserIdentity $user, PageReference $target)
Must be called separately for Subject & Talk namespaces.
MediaWiki\Watchlist\WatchedItemStoreInterface\clearUserWatchedItemsUsingJobQueue
clearUserWatchedItemsUsingJobQueue(UserIdentity $user)
Queues a job that will clear the users watchlist using the Job Queue.
MediaWiki\Watchlist\WatchedItemStoreInterface\removeLabels
removeLabels(UserIdentity $user, array $targets, array $labels)
Remove labels from a set of watchlist items.
MediaWiki\Watchlist\WatchedItemStoreInterface\getWatchedItem
getWatchedItem(UserIdentity $user, PageReference $target)
Get an item (may be cached)
MediaWiki\Watchlist\WatchedItemStoreInterface\removeExpired
removeExpired(int $limit, bool $deleteOrphans=false)
Remove some number of expired watchlist items.
MediaWiki\Watchlist\WatchedItemStoreInterface\maybeEnqueueWatchlistExpiryJob
maybeEnqueueWatchlistExpiryJob()
Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled,...
MediaWiki\Watchlist\WatchedItemStoreInterface\countUnreadNotifications
countUnreadNotifications(UserIdentity $user, $unreadLimit=null)
MediaWiki\Watchlist
Definition
ActivityUpdateJob.php:7
includes
Watchlist
WatchedItemStoreInterface.php
Generated on Tue Mar 10 2026 00:28:26 for MediaWiki by
1.10.0