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
95
public
function
countVisitingWatchersMultiple
(
96
array $targetsWithVisitThresholds,
97
$minimumWatchers =
null
98
);
99
110
public
function
getWatchedItem
(
UserIdentity
$user,
PageReference
$target );
111
122
public
function
loadWatchedItem
(
UserIdentity
$user,
PageReference
$target );
123
134
public
function
loadWatchedItemsBatch
(
UserIdentity
$user, array $targets );
135
149
public
function
getWatchedItemsForUser
(
UserIdentity
$user, array $options = [] );
150
161
public
function
isWatched
(
UserIdentity
$user,
PageReference
$target );
162
174
public
function
isTempWatched
(
UserIdentity
$user,
PageReference
$target ): bool;
175
187
public
function
getNotificationTimestampsBatch
(
UserIdentity
$user, array $targets );
188
200
public
function
addWatch
(
UserIdentity
$user,
PageReference
$target, ?
string
$expiry =
null
);
201
213
public
function
addWatchBatchForUser
(
UserIdentity
$user, array $targets, ?
string
$expiry =
null
);
214
226
public
function
removeWatch
(
UserIdentity
$user,
PageReference
$target );
227
237
public
function
setNotificationTimestampsForUser
(
238
UserIdentity
$user,
239
$timestamp,
240
array $targets = []
241
);
242
251
public
function
resetAllNotificationTimestampsForUser
(
UserIdentity
$user, $timestamp =
null
);
252
263
public
function
updateNotificationTimestamp
(
264
UserIdentity
$editor,
PageReference
$target, $timestamp );
265
281
public
function
resetNotificationTimestamp
(
282
UserIdentity
$user,
PageReference
$title, $force =
''
, $oldid = 0 );
283
293
public
function
countUnreadNotifications
(
UserIdentity
$user, $unreadLimit =
null
);
294
306
public
function
duplicateAllAssociatedEntries
(
PageReference
$oldTarget,
PageReference
$newTarget );
307
320
public
function
duplicateEntry
(
PageReference
$oldTarget,
PageReference
$newTarget );
321
331
public
function
clearUserWatchedItems
(
UserIdentity
$user );
332
342
public
function
mustClearWatchedItemsUsingJobQueue
(
UserIdentity
$user ): bool;
343
351
public
function
clearUserWatchedItemsUsingJobQueue
(
UserIdentity
$user );
352
359
public
function
maybeEnqueueWatchlistExpiryJob
(): void;
360
369
public
function
removeWatchBatchForUser
(
UserIdentity
$user, array $targets );
370
384
public
function
getLatestNotificationTimestamp
(
385
$timestamp,
UserIdentity
$user,
PageReference
$target );
386
394
public
function
countExpired
(): int;
395
406
public
function
removeExpired
(
int
$limit,
bool
$deleteOrphans =
false
): void;
407
417
public
function
addLabels
(
UserIdentity
$user, array $targets, array $labels ): void;
418
428
public
function
removeLabels
(
UserIdentity
$user, array $targets, array $labels ): void;
429
}
431
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 Sat Dec 6 2025 21:27:25 for MediaWiki by
1.10.0