MediaWiki master
MediaWiki\Watchlist\NoWriteWatchedItemStore Class Reference

Inherits MediaWiki\Watchlist\WatchedItemStoreInterface.

Collaboration diagram for MediaWiki\Watchlist\NoWriteWatchedItemStore:

Public Member Functions

 __construct (WatchedItemStoreInterface $actualStore)
 Initially set WatchedItemStore that will be used in cases where writing is not needed.
 
 addLabels (UserIdentity $user, array $targets, array $labels)
 Add a labels to a set of watchlist items.The same labels are applied to each item. Ignore existing labels.
Since
1.46
Parameters
UserIdentity$user
PageReference[]$targets
(WatchlistLabel|int)[]$labels The label objects or IDs

 
 addWatch (UserIdentity $user, PageReference $target, ?string $expiry=null)
 Must be called separately for Subject & Talk namespaces.
Since
1.31 Method added.
1.35 Accepts $expiry parameter.
Parameters
UserIdentity$user
PageReference$target
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp(). null will not create an expiry, or leave it unchanged should one already exist.

 
 addWatchBatchForUser (UserIdentity $user, array $targets, ?string $expiry=null)
 
Since
1.31 Method added.
1.35 Accepts $expiry parameter.
Parameters
UserIdentity$user
PageReference[]$targets
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist.
Returns
bool success

 
 clearUserWatchedItems (UserIdentity $user)
 Synchronously clear the users watchlist.
Since
1.31
Parameters
UserIdentity$user
Returns
bool True on success, false if {
See also
clearUserWatchedItemsUsingJobQueue} must be used instead

 
 clearUserWatchedItemsUsingJobQueue (UserIdentity $user)
 Queues a job that will clear the users watchlist using the Job Queue.
Since
1.31
Parameters
UserIdentity$user

 
 countExpired ()
 Get the number of watchlist items that expire before the current time.
Since
1.35
Returns
int

 
 countUnreadNotifications (UserIdentity $user, $unreadLimit=null)
 
Since
1.31
Parameters
UserIdentity$user
int | null$unreadLimit
Returns
int|bool The number of unread notifications true if greater than or equal to $unreadLimit

 
 countVisitingWatchers (PageReference $target, $threshold)
 Number of page watchers who also visited a "recent" edit.
Since
1.31
Parameters
PageReference$target
mixed$thresholdtimestamp accepted by wfTimestamp
Returns
int

 
 countVisitingWatchersMultiple (array $targetsWithVisitThresholds, $minimumWatchers=null)
 Number of watchers of each page who have visited recent edits to that page.
Since
1.31
Parameters
array$targetsWithVisitThresholdsarray of pairs (PageReference $target, mixed $threshold), $threshold is:
  • a timestamp of the recent edit if $target exists (format accepted by wfTimestamp)
  • null if $target doesn't exist
int | null$minimumWatchers
Returns
array multi-dimensional like $return[$namespaceId][$titleString] = $watchers, where $watchers is an int:
  • if the page exists, number of users watching who have visited the page recently
  • if the page doesn't exist, number of users that have the page on their watchlist
  • 0 means there are no visiting watchers or their number is below the minimumWatchers option (if passed).

 
 countWatchedItems (UserIdentity $user)
 Count the number of individual items that are watched by the user.If a subject and corresponding talk page are watched this will return 2.
Since
1.31
Parameters
UserIdentity$user
Returns
int

 
 countWatchers (PageReference $target)
 
Since
1.31
Parameters
PageReference$target
Returns
int

 
 countWatchersMultiple (array $targets, array $options=[])
 
Since
1.31
Parameters
PageReference[]$targets
array$optionsAllowed keys: 'minimumWatchers' => int
Returns
array multi dimensional like $return[$namespaceId][$titleString] = int $watchers All targets will be present in the result. 0 either means no watchers or the number of watchers was below the minimumWatchers option if passed.

 
 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.To be used for page renames and such.
Since
1.31
Parameters
PageReference$oldTarget
PageReference$newTarget

 
 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.To be used for page renames and such. This must be called separately for Subject and Talk pages
Since
1.31
Parameters
PageReference$oldTarget
PageReference$newTarget

 
 getLatestNotificationTimestamp ( $timestamp, UserIdentity $user, PageReference $target)
 Convert $timestamp to TS::MW or return null if the page was visited since then by $user.Use this only on single-user methods (having higher read-after-write expectations) and not in places involving arbitrary batches of different usersUsage of this method should be limited to WatchedItem* classes
Parameters
string | null$timestampValue of wl_notificationtimestamp from the DB
UserIdentity$user
PageReference$target
Returns
string|null TS::MW timestamp of first unseen revision or null if there isn't one

 
 getNotificationTimestampsBatch (UserIdentity $user, array $targets)
 
Since
1.31
Parameters
UserIdentity$user
PageReference[]$targets
Returns
array multi-dimensional like $return[$namespaceId][$titleString] = $timestamp, where $timestamp is:
  • string|null value of wl_notificationtimestamp,
  • false if $target is not watched by $user.

 
 getWatchedItem (UserIdentity $user, PageReference $target)
 Get an item (may be cached)
Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
WatchedItem|false

 
 getWatchedItemsForUser (UserIdentity $user, array $options=[])
 
Since
1.31 Method Added
Parameters
UserIdentity$user
array$optionsAllowed keys:
  • 'forWrite': bool optional whether to use the primary database instead of a replica (defaults to false)
  • 'sort': string optional self::SORT_ASC or self:SORT_DESC (defaults to SORT_ASC)
  • 'offsetConds': optional array SQL conditions that the watched items must match
  • 'namespaces': array
  • 'limit': int max number of watched items to return
Returns
WatchedItem[]

 
 isTempWatched (UserIdentity $user, PageReference $target)
 Whether the page is only being watched temporarily (has expiry).Must be called separately for Subject & Talk namespaces.
Since
1.35
Parameters
UserIdentity$user
PageReference$target
Returns
bool

 
 isWatched (UserIdentity $user, PageReference $target)
 Must be called separately for Subject & Talk namespaces.
Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
bool

 
 loadWatchedItem (UserIdentity $user, PageReference $target)
 Loads an item from the db.
Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
WatchedItem|false

 
 loadWatchedItemsBatch (UserIdentity $user, array $targets)
 Loads a set of WatchedItems from the db.
Since
1.36
Parameters
UserIdentity$user
PageReference[]$targets
Returns
WatchedItem[]

 
 maybeEnqueueWatchlistExpiryJob ()
 Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled, based on the value of $wgWatchlistPurgeRate.
Since
1.36

 
 mustClearWatchedItemsUsingJobQueue (UserIdentity $user)
 Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems()
Since
1.35
Parameters
UserIdentity$user
Returns
bool

 
 removeExpired (int $limit, bool $deleteOrphans=false)
 Remove some number of expired watchlist items.
Since
1.35
Parameters
int$limitThe number of items to remove.
bool$deleteOrphansWhether to also delete watchlist_expiry rows that have no related watchlist rows (because not all code knows about the expiry table yet). This runs two extra queries, so is only done from the purgeExpiredWatchlistItems.php maintenance script.

 
 removeLabels (UserIdentity $user, array $targets, array $labels)
 Remove labels from a set of watchlist items.The same labels are removed from each item. Ignore missing label members.
Since
1.46
Parameters
UserIdentity$user
PageReference[]$targets
(WatchlistLabel|int)[]$labels

 
 removeWatch (UserIdentity $user, PageReference $target)
 Removes an entry for the UserIdentity watching the target Must be called separately for Subject & Talk namespaces.
Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
bool success

 
 removeWatchBatchForUser (UserIdentity $user, array $targets)
 
Since
1.32
Parameters
UserIdentity$user
PageReference[]$targets
Returns
bool Whether any watched items were removed

 
 resetAllNotificationTimestampsForUser (UserIdentity $user, $timestamp=null)
 Reset all watchlist notification timestamps for a user using the job queue.
Since
1.31
Parameters
UserIdentity$userThe user to reset the timestamps for
string | int | null$timestampValue to set all timestamps to, null to clear them

 
 resetNotificationTimestamp (UserIdentity $user, PageReference $title, $force='', $oldid=0)
 Reset the notification timestamp of this entry.
Since
1.31
Parameters
UserIdentity$user
PageReference$title
string$forceWhether to force the write query to be executed even if the page is not watched or the notification timestamp is already NULL. 'force' in order to force
int$oldidThe revision id being viewed. If not given or 0, latest revision is assumed.
Returns
bool success Whether a job was enqueued

 
 setNotificationTimestampsForUser (UserIdentity $user, $timestamp, array $targets=[])
 
Since
1.31
Parameters
UserIdentity$userThe user to set the timestamps for
string | null$timestampSet the update timestamp to this value
PageReference[]$targetsList of targets to update. Default to all targets.
Returns
bool success

 
 updateNotificationTimestamp (UserIdentity $editor, $target, $timestamp)
 
- Public Member Functions inherited from MediaWiki\Watchlist\WatchedItemStoreInterface
 updateNotificationTimestamp (UserIdentity $editor, PageReference $target, $timestamp)
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Watchlist\WatchedItemStoreInterface
const SORT_ASC = 'ASC'
 
const SORT_DESC = 'DESC'
 

Detailed Description

Access: internal
Since
1.31

Definition at line 22 of file NoWriteWatchedItemStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Watchlist\NoWriteWatchedItemStore::__construct ( WatchedItemStoreInterface $actualStore)

Initially set WatchedItemStore that will be used in cases where writing is not needed.

Definition at line 31 of file NoWriteWatchedItemStore.php.

Member Function Documentation

◆ addLabels()

MediaWiki\Watchlist\NoWriteWatchedItemStore::addLabels ( UserIdentity $user,
array $targets,
array $labels )

Add a labels to a set of watchlist items.The same labels are applied to each item. Ignore existing labels.

Since
1.46
Parameters
UserIdentity$user
PageReference[]$targets
(WatchlistLabel|int)[]$labels The label objects or IDs

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 212 of file NoWriteWatchedItemStore.php.

◆ addWatch()

MediaWiki\Watchlist\NoWriteWatchedItemStore::addWatch ( UserIdentity $user,
PageReference $target,
?string $expiry = null )

Must be called separately for Subject & Talk namespaces.

Since
1.31 Method added.
1.35 Accepts $expiry parameter.
Parameters
UserIdentity$user
PageReference$target
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp(). null will not create an expiry, or leave it unchanged should one already exist.

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 120 of file NoWriteWatchedItemStore.php.

◆ addWatchBatchForUser()

MediaWiki\Watchlist\NoWriteWatchedItemStore::addWatchBatchForUser ( UserIdentity $user,
array $targets,
?string $expiry = null )

Since
1.31 Method added.
1.35 Accepts $expiry parameter.
Parameters
UserIdentity$user
PageReference[]$targets
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist.
Returns
bool success

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 125 of file NoWriteWatchedItemStore.php.

◆ clearUserWatchedItems()

MediaWiki\Watchlist\NoWriteWatchedItemStore::clearUserWatchedItems ( UserIdentity $user)

Synchronously clear the users watchlist.

Since
1.31
Parameters
UserIdentity$user
Returns
bool True on success, false if {
See also
clearUserWatchedItemsUsingJobQueue} must be used instead

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 170 of file NoWriteWatchedItemStore.php.

◆ clearUserWatchedItemsUsingJobQueue()

MediaWiki\Watchlist\NoWriteWatchedItemStore::clearUserWatchedItemsUsingJobQueue ( UserIdentity $user)

Queues a job that will clear the users watchlist using the Job Queue.

Since
1.31
Parameters
UserIdentity$user

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 180 of file NoWriteWatchedItemStore.php.

◆ countExpired()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countExpired ( )

Get the number of watchlist items that expire before the current time.

Since
1.35
Returns
int

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 202 of file NoWriteWatchedItemStore.php.

◆ countUnreadNotifications()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countUnreadNotifications ( UserIdentity $user,
$unreadLimit = null )

Since
1.31
Parameters
UserIdentity$user
int | null$unreadLimit
Returns
int|bool The number of unread notifications true if greater than or equal to $unreadLimit

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 105 of file NoWriteWatchedItemStore.php.

◆ countVisitingWatchers()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countVisitingWatchers ( PageReference $target,
$threshold )

Number of page watchers who also visited a "recent" edit.

Since
1.31
Parameters
PageReference$target
mixed$thresholdtimestamp accepted by wfTimestamp
Returns
int

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 46 of file NoWriteWatchedItemStore.php.

◆ countVisitingWatchersMultiple()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countVisitingWatchersMultiple ( array $targetsWithVisitThresholds,
$minimumWatchers = null )

Number of watchers of each page who have visited recent edits to that page.

Since
1.31
Parameters
array$targetsWithVisitThresholdsarray of pairs (PageReference $target, mixed $threshold), $threshold is:
  • a timestamp of the recent edit if $target exists (format accepted by wfTimestamp)
  • null if $target doesn't exist
int | null$minimumWatchers
Returns
array multi-dimensional like $return[$namespaceId][$titleString] = $watchers, where $watchers is an int:
  • if the page exists, number of users watching who have visited the page recently
  • if the page doesn't exist, number of users that have the page on their watchlist
  • 0 means there are no visiting watchers or their number is below the minimumWatchers option (if passed).

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 59 of file NoWriteWatchedItemStore.php.

◆ countWatchedItems()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countWatchedItems ( UserIdentity $user)

Count the number of individual items that are watched by the user.If a subject and corresponding talk page are watched this will return 2.

Since
1.31
Parameters
UserIdentity$user
Returns
int

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 36 of file NoWriteWatchedItemStore.php.

◆ countWatchers()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countWatchers ( PageReference $target)

Since
1.31
Parameters
PageReference$target
Returns
int

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 41 of file NoWriteWatchedItemStore.php.

◆ countWatchersMultiple()

MediaWiki\Watchlist\NoWriteWatchedItemStore::countWatchersMultiple ( array $targets,
array $options = [] )

Since
1.31
Parameters
PageReference[]$targets
array$optionsAllowed keys: 'minimumWatchers' => int
Returns
array multi dimensional like $return[$namespaceId][$titleString] = int $watchers All targets will be present in the result. 0 either means no watchers or the number of watchers was below the minimumWatchers option if passed.

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 51 of file NoWriteWatchedItemStore.php.

◆ duplicateAllAssociatedEntries()

MediaWiki\Watchlist\NoWriteWatchedItemStore::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.To be used for page renames and such.

Since
1.31
Parameters
PageReference$oldTarget
PageReference$newTarget

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 110 of file NoWriteWatchedItemStore.php.

◆ duplicateEntry()

MediaWiki\Watchlist\NoWriteWatchedItemStore::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.To be used for page renames and such. This must be called separately for Subject and Talk pages

Since
1.31
Parameters
PageReference$oldTarget
PageReference$newTarget

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 115 of file NoWriteWatchedItemStore.php.

◆ getLatestNotificationTimestamp()

MediaWiki\Watchlist\NoWriteWatchedItemStore::getLatestNotificationTimestamp ( $timestamp,
UserIdentity $user,
PageReference $target )

Convert $timestamp to TS::MW or return null if the page was visited since then by $user.Use this only on single-user methods (having higher read-after-write expectations) and not in places involving arbitrary batches of different usersUsage of this method should be limited to WatchedItem* classes

Parameters
string | null$timestampValue of wl_notificationtimestamp from the DB
UserIdentity$user
PageReference$target
Returns
string|null TS::MW timestamp of first unseen revision or null if there isn't one

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 195 of file NoWriteWatchedItemStore.php.

References wfTimestampOrNull().

◆ getNotificationTimestampsBatch()

MediaWiki\Watchlist\NoWriteWatchedItemStore::getNotificationTimestampsBatch ( UserIdentity $user,
array $targets )

Since
1.31
Parameters
UserIdentity$user
PageReference[]$targets
Returns
array multi-dimensional like $return[$namespaceId][$titleString] = $timestamp, where $timestamp is:
  • string|null value of wl_notificationtimestamp,
  • false if $target is not watched by $user.

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 100 of file NoWriteWatchedItemStore.php.

◆ getWatchedItem()

MediaWiki\Watchlist\NoWriteWatchedItemStore::getWatchedItem ( UserIdentity $user,
PageReference $target )

Get an item (may be cached)

Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
WatchedItem|false

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 70 of file NoWriteWatchedItemStore.php.

◆ getWatchedItemsForUser()

MediaWiki\Watchlist\NoWriteWatchedItemStore::getWatchedItemsForUser ( UserIdentity $user,
array $options = [] )

Since
1.31 Method Added
Parameters
UserIdentity$user
array$optionsAllowed keys:
  • 'forWrite': bool optional whether to use the primary database instead of a replica (defaults to false)
  • 'sort': string optional self::SORT_ASC or self:SORT_DESC (defaults to SORT_ASC)
  • 'offsetConds': optional array SQL conditions that the watched items must match
  • 'namespaces': array
  • 'limit': int max number of watched items to return
Returns
WatchedItem[]

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 85 of file NoWriteWatchedItemStore.php.

◆ isTempWatched()

MediaWiki\Watchlist\NoWriteWatchedItemStore::isTempWatched ( UserIdentity $user,
PageReference $target )

Whether the page is only being watched temporarily (has expiry).Must be called separately for Subject & Talk namespaces.

Since
1.35
Parameters
UserIdentity$user
PageReference$target
Returns
bool

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 95 of file NoWriteWatchedItemStore.php.

◆ isWatched()

MediaWiki\Watchlist\NoWriteWatchedItemStore::isWatched ( UserIdentity $user,
PageReference $target )

Must be called separately for Subject & Talk namespaces.

Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
bool

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 90 of file NoWriteWatchedItemStore.php.

◆ loadWatchedItem()

MediaWiki\Watchlist\NoWriteWatchedItemStore::loadWatchedItem ( UserIdentity $user,
PageReference $target )

Loads an item from the db.

Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
WatchedItem|false

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 75 of file NoWriteWatchedItemStore.php.

◆ loadWatchedItemsBatch()

MediaWiki\Watchlist\NoWriteWatchedItemStore::loadWatchedItemsBatch ( UserIdentity $user,
array $targets )

Loads a set of WatchedItems from the db.

Since
1.36
Parameters
UserIdentity$user
PageReference[]$targets
Returns
WatchedItem[]

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 80 of file NoWriteWatchedItemStore.php.

◆ maybeEnqueueWatchlistExpiryJob()

MediaWiki\Watchlist\NoWriteWatchedItemStore::maybeEnqueueWatchlistExpiryJob ( )

Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled, based on the value of $wgWatchlistPurgeRate.

Since
1.36

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 185 of file NoWriteWatchedItemStore.php.

◆ mustClearWatchedItemsUsingJobQueue()

MediaWiki\Watchlist\NoWriteWatchedItemStore::mustClearWatchedItemsUsingJobQueue ( UserIdentity $user)

Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems()

Since
1.35
Parameters
UserIdentity$user
Returns
bool

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 175 of file NoWriteWatchedItemStore.php.

◆ removeExpired()

MediaWiki\Watchlist\NoWriteWatchedItemStore::removeExpired ( int $limit,
bool $deleteOrphans = false )

Remove some number of expired watchlist items.

Since
1.35
Parameters
int$limitThe number of items to remove.
bool$deleteOrphansWhether to also delete watchlist_expiry rows that have no related watchlist rows (because not all code knows about the expiry table yet). This runs two extra queries, so is only done from the purgeExpiredWatchlistItems.php maintenance script.

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 207 of file NoWriteWatchedItemStore.php.

◆ removeLabels()

MediaWiki\Watchlist\NoWriteWatchedItemStore::removeLabels ( UserIdentity $user,
array $targets,
array $labels )

Remove labels from a set of watchlist items.The same labels are removed from each item. Ignore missing label members.

Since
1.46
Parameters
UserIdentity$user
PageReference[]$targets
(WatchlistLabel|int)[]$labels

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 217 of file NoWriteWatchedItemStore.php.

◆ removeWatch()

MediaWiki\Watchlist\NoWriteWatchedItemStore::removeWatch ( UserIdentity $user,
PageReference $target )

Removes an entry for the UserIdentity watching the target Must be called separately for Subject & Talk namespaces.

Since
1.31
Parameters
UserIdentity$user
PageReference$target
Returns
bool success

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 134 of file NoWriteWatchedItemStore.php.

◆ removeWatchBatchForUser()

MediaWiki\Watchlist\NoWriteWatchedItemStore::removeWatchBatchForUser ( UserIdentity $user,
array $targets )

Since
1.32
Parameters
UserIdentity$user
PageReference[]$targets
Returns
bool Whether any watched items were removed

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 190 of file NoWriteWatchedItemStore.php.

◆ resetAllNotificationTimestampsForUser()

MediaWiki\Watchlist\NoWriteWatchedItemStore::resetAllNotificationTimestampsForUser ( UserIdentity $user,
$timestamp = null )

Reset all watchlist notification timestamps for a user using the job queue.

Since
1.31
Parameters
UserIdentity$userThe user to reset the timestamps for
string | int | null$timestampValue to set all timestamps to, null to clear them

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 155 of file NoWriteWatchedItemStore.php.

◆ resetNotificationTimestamp()

MediaWiki\Watchlist\NoWriteWatchedItemStore::resetNotificationTimestamp ( UserIdentity $user,
PageReference $title,
$force = '',
$oldid = 0 )

Reset the notification timestamp of this entry.

Since
1.31
Parameters
UserIdentity$user
PageReference$title
string$forceWhether to force the write query to be executed even if the page is not watched or the notification timestamp is already NULL. 'force' in order to force
int$oldidThe revision id being viewed. If not given or 0, latest revision is assumed.
Returns
bool success Whether a job was enqueued

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 160 of file NoWriteWatchedItemStore.php.

◆ setNotificationTimestampsForUser()

MediaWiki\Watchlist\NoWriteWatchedItemStore::setNotificationTimestampsForUser ( UserIdentity $user,
$timestamp,
array $targets = [] )

Since
1.31
Parameters
UserIdentity$userThe user to set the timestamps for
string | null$timestampSet the update timestamp to this value
PageReference[]$targetsList of targets to update. Default to all targets.
Returns
bool success

Implements MediaWiki\Watchlist\WatchedItemStoreInterface.

Definition at line 139 of file NoWriteWatchedItemStore.php.

◆ updateNotificationTimestamp()

MediaWiki\Watchlist\NoWriteWatchedItemStore::updateNotificationTimestamp ( UserIdentity $editor,
$target,
$timestamp )

Definition at line 148 of file NoWriteWatchedItemStore.php.


The documentation for this class was generated from the following file: