MediaWiki master
|
Inherits MediaWiki\Watchlist\WatchedItemStoreInterface.
Public Member Functions | |||||||||||||
__construct (WatchedItemStoreInterface $actualStore) | |||||||||||||
Initially set WatchedItemStore that will be used in cases where writing is not needed. | |||||||||||||
addWatch (UserIdentity $user, $target, ?string $expiry=null) | |||||||||||||
Must be called separately for Subject & Talk namespaces.
| |||||||||||||
addWatchBatchForUser (UserIdentity $user, array $targets, ?string $expiry=null) | |||||||||||||
| |||||||||||||
clearUserWatchedItems (UserIdentity $user) | |||||||||||||
Synchronously clear the users watchlist.
| |||||||||||||
clearUserWatchedItemsUsingJobQueue (UserIdentity $user) | |||||||||||||
Queues a job that will clear the users watchlist using the Job Queue.
| |||||||||||||
countExpired () | |||||||||||||
Get the number of watchlist items that expire before the current time.
| |||||||||||||
countUnreadNotifications (UserIdentity $user, $unreadLimit=null) | |||||||||||||
| |||||||||||||
countVisitingWatchers ( $target, $threshold) | |||||||||||||
Number of page watchers who also visited a "recent" edit.
| |||||||||||||
countVisitingWatchersMultiple (array $targetsWithVisitThresholds, $minimumWatchers=null) | |||||||||||||
Number of watchers of each page who have visited recent edits to that page.
| |||||||||||||
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.
| |||||||||||||
countWatchers ( $target) | |||||||||||||
| |||||||||||||
countWatchersMultiple (array $targets, array $options=[]) | |||||||||||||
| |||||||||||||
duplicateAllAssociatedEntries ( $oldTarget, $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.
| |||||||||||||
duplicateEntry ( $oldTarget, $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
| |||||||||||||
getLatestNotificationTimestamp ( $timestamp, UserIdentity $user, $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
| |||||||||||||
getNotificationTimestampsBatch (UserIdentity $user, array $targets) | |||||||||||||
| |||||||||||||
getWatchedItem (UserIdentity $user, $target) | |||||||||||||
Get an item (may be cached)
| |||||||||||||
getWatchedItemsForUser (UserIdentity $user, array $options=[]) | |||||||||||||
| |||||||||||||
isTempWatched (UserIdentity $user, $target) | |||||||||||||
Whether the page is only being watched temporarily (has expiry).Must be called separately for Subject & Talk namespaces.
| |||||||||||||
isWatched (UserIdentity $user, $target) | |||||||||||||
Must be called separately for Subject & Talk namespaces.
| |||||||||||||
loadWatchedItem (UserIdentity $user, $target) | |||||||||||||
Loads an item from the db.
| |||||||||||||
loadWatchedItemsBatch (UserIdentity $user, array $targets) | |||||||||||||
Loads a set of WatchedItems from the db.
| |||||||||||||
maybeEnqueueWatchlistExpiryJob () | |||||||||||||
Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled, based on the value of $wgWatchlistPurgeRate.
| |||||||||||||
mustClearWatchedItemsUsingJobQueue (UserIdentity $user) | |||||||||||||
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems()
| |||||||||||||
removeExpired (int $limit, bool $deleteOrphans=false) | |||||||||||||
Remove some number of expired watchlist items.
| |||||||||||||
removeWatch (UserIdentity $user, $target) | |||||||||||||
Removes an entry for the UserIdentity watching the target (LinkTarget or PageIdentity) Must be called separately for Subject & Talk namespaces.
| |||||||||||||
removeWatchBatchForUser (UserIdentity $user, array $targets) | |||||||||||||
| |||||||||||||
resetAllNotificationTimestampsForUser (UserIdentity $user, $timestamp=null) | |||||||||||||
Reset all watchlist notification timestamps for a user using the job queue.
| |||||||||||||
resetNotificationTimestamp (UserIdentity $user, $title, $force='', $oldid=0) | |||||||||||||
Reset the notification timestamp of this entry.
| |||||||||||||
setNotificationTimestampsForUser (UserIdentity $user, $timestamp, array $targets=[]) | |||||||||||||
| |||||||||||||
updateNotificationTimestamp (UserIdentity $editor, $target, $timestamp) | |||||||||||||
| |||||||||||||
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\Watchlist\WatchedItemStoreInterface | |
const | SORT_ASC = 'ASC' |
const | SORT_DESC = 'DESC' |
MediaWiki\Watchlist\NoWriteWatchedItemStore::__construct | ( | WatchedItemStoreInterface | $actualStore | ) |
Initially set WatchedItemStore that will be used in cases where writing is not needed.
WatchedItemStoreInterface | $actualStore |
Definition at line 42 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::addWatch | ( | UserIdentity | $user, |
$target, | |||
?string | $expiry = null ) |
Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
string | null | $expiry | Optional 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 131 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::addWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets, | ||
?string | $expiry = null ) |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 136 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::clearUserWatchedItems | ( | UserIdentity | $user | ) |
Synchronously clear the users watchlist.
UserIdentity | $user |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 181 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::clearUserWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Queues a job that will clear the users watchlist using the Job Queue.
UserIdentity | $user |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 191 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countExpired | ( | ) |
Get the number of watchlist items that expire before the current time.
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 213 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countUnreadNotifications | ( | UserIdentity | $user, |
$unreadLimit = null ) |
UserIdentity | $user | |
int | null | $unreadLimit |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 116 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countVisitingWatchers | ( | $target, | |
$threshold ) |
Number of page watchers who also visited a "recent" edit.
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
mixed | $threshold | timestamp accepted by wfTimestamp |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 57 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countVisitingWatchersMultiple | ( | array | $targetsWithVisitThresholds, |
$minimumWatchers = null ) |
Number of watchers of each page who have visited recent edits to that page.
array | $targetsWithVisitThresholds | array of pairs (LinkTarget|PageIdentity $target, mixed $threshold), $threshold is:
|
int | null | $minimumWatchers |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 70 of file NoWriteWatchedItemStore.php.
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.
UserIdentity | $user |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 47 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countWatchers | ( | $target | ) |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 52 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::countWatchersMultiple | ( | array | $targets, |
array | $options = [] ) |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
array | $options | Allowed keys: 'minimumWatchers' => int |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 62 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::duplicateAllAssociatedEntries | ( | $oldTarget, | |
$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.
LinkTarget | PageIdentity | $oldTarget | deprecated passing LinkTarget since 1.36 |
LinkTarget | PageIdentity | $newTarget | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 121 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::duplicateEntry | ( | $oldTarget, | |
$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
LinkTarget | PageIdentity | $oldTarget | deprecated passing LinkTarget since 1.36 |
LinkTarget | PageIdentity | $newTarget | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 126 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::getLatestNotificationTimestamp | ( | $timestamp, | |
UserIdentity | $user, | ||
$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
string | null | $timestamp | Value of wl_notificationtimestamp from the DB |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 206 of file NoWriteWatchedItemStore.php.
References wfTimestampOrNull().
MediaWiki\Watchlist\NoWriteWatchedItemStore::getNotificationTimestampsBatch | ( | UserIdentity | $user, |
array | $targets ) |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 111 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::getWatchedItem | ( | UserIdentity | $user, |
$target ) |
Get an item (may be cached)
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 81 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::getWatchedItemsForUser | ( | UserIdentity | $user, |
array | $options = [] ) |
UserIdentity | $user | |
array | $options | Allowed keys: 'forWrite' => bool defaults to false 'sort' => string optional sorting by namespace ID and title one of the self::SORT_* constants 'sortByExpiry' => bool optional sorts by expiration date, with the titles that will expire soonest at the top. |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 96 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::isTempWatched | ( | UserIdentity | $user, |
$target ) |
Whether the page is only being watched temporarily (has expiry).Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 106 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::isWatched | ( | UserIdentity | $user, |
$target ) |
Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 101 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::loadWatchedItem | ( | UserIdentity | $user, |
$target ) |
Loads an item from the db.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 86 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::loadWatchedItemsBatch | ( | UserIdentity | $user, |
array | $targets ) |
Loads a set of WatchedItems from the db.
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 91 of file NoWriteWatchedItemStore.php.
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.
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 196 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::mustClearWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Does the size of the users watchlist require clearUserWatchedItemsUsingJobQueue() to be used instead of clearUserWatchedItems()
UserIdentity | $user |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 186 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::removeExpired | ( | int | $limit, |
bool | $deleteOrphans = false ) |
Remove some number of expired watchlist items.
int | $limit | The number of items to remove. |
bool | $deleteOrphans | Whether 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 218 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::removeWatch | ( | UserIdentity | $user, |
$target ) |
Removes an entry for the UserIdentity watching the target (LinkTarget or PageIdentity) Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 145 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::removeWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets ) |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 201 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::resetAllNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp = null ) |
Reset all watchlist notification timestamps for a user using the job queue.
UserIdentity | $user | The user to reset the timestamps for |
string | int | null | $timestamp | Value to set all timestamps to, null to clear them |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 166 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::resetNotificationTimestamp | ( | UserIdentity | $user, |
$title, | |||
$force = '', | |||
$oldid = 0 ) |
Reset the notification timestamp of this entry.
UserIdentity | $user | |
LinkTarget | PageIdentity | $title | deprecated passing LinkTarget since 1.36 |
string | $force | Whether 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 | $oldid | The revision id being viewed. If not given or 0, latest revision is assumed. |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 171 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::setNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp, | |||
array | $targets = [] ) |
UserIdentity | $user | The user to set the timestamps for |
string | null | $timestamp | Set the update timestamp to this value |
LinkTarget[] | PageIdentity[] | $targets | List of targets to update. Default to all targets. deprecated passing LinkTarget[] since 1.36 |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 150 of file NoWriteWatchedItemStore.php.
MediaWiki\Watchlist\NoWriteWatchedItemStore::updateNotificationTimestamp | ( | UserIdentity | $editor, |
$target, | |||
$timestamp ) |
UserIdentity | $editor | The editor that triggered the update. Their notification timestamp will not be updated(they have already seen it) |
LinkTarget | PageIdentity | $target | The target to update timestamps for deprecated passing LinkTarget since 1.36 |
string | $timestamp | Set the update (first unseen revision) timestamp to this value |
Implements MediaWiki\Watchlist\WatchedItemStoreInterface.
Definition at line 159 of file NoWriteWatchedItemStore.php.