MediaWiki
1.34.0
|
Public Member Functions | |
__construct (WatchedItemStoreInterface $actualStore) | |
Initialy set WatchedItemStore that will be used in cases where writing is not needed. More... | |
addWatch (UserIdentity $user, LinkTarget $target) | |
Must be called separately for Subject & Talk namespaces. More... | |
addWatchBatchForUser (UserIdentity $user, array $targets) | |
clearUserWatchedItems (UserIdentity $user) | |
Queues a job that will clear the users watchlist using the Job Queue. More... | |
clearUserWatchedItemsUsingJobQueue (UserIdentity $user) | |
Queues a job that will clear the users watchlist using the Job Queue. More... | |
countUnreadNotifications (UserIdentity $user, $unreadLimit=null) | |
countVisitingWatchers (LinkTarget $target, $threshold) | |
Number of page watchers who also visited a "recent" edit. More... | |
countVisitingWatchersMultiple (array $targetsWithVisitThresholds, $minimumWatchers=null) | |
Number of watchers of each page who have visited recent edits to that page. More... | |
countWatchedItems (UserIdentity $user) | |
Count the number of individual items that are watched by the user. More... | |
countWatchers (LinkTarget $target) | |
countWatchersMultiple (array $targets, array $options=[]) | |
duplicateAllAssociatedEntries (LinkTarget $oldTarget, LinkTarget $newTarget) | |
Check if the given title already is watched by the user, and if so add a watch for the new title. More... | |
duplicateEntry (LinkTarget $oldTarget, LinkTarget $newTarget) | |
Check if the given title already is watched by the user, and if so add a watch for the new title. More... | |
getLatestNotificationTimestamp ( $timestamp, UserIdentity $user, LinkTarget $target) | |
Convert $timestamp to TS_MW or return null if the page was visited since then by $user. More... | |
getNotificationTimestampsBatch (UserIdentity $user, array $targets) | |
getWatchedItem (UserIdentity $user, LinkTarget $target) | |
Get an item (may be cached) More... | |
getWatchedItemsForUser (UserIdentity $user, array $options=[]) | |
isWatched (UserIdentity $user, LinkTarget $target) | |
Must be called separately for Subject & Talk namespaces. More... | |
loadWatchedItem (UserIdentity $user, LinkTarget $target) | |
Loads an item from the db. More... | |
removeWatch (UserIdentity $user, LinkTarget $target) | |
Removes an entry for the UserIdentity watching the LinkTarget Must be called separately for Subject & Talk namespaces. More... | |
removeWatchBatchForUser (UserIdentity $user, array $titles) | |
resetAllNotificationTimestampsForUser (UserIdentity $user) | |
Reset all watchlist notificaton timestamps for a user using the job queue. More... | |
resetNotificationTimestamp (UserIdentity $user, LinkTarget $title, $force='', $oldid=0) | |
Reset the notification timestamp of this entry. More... | |
setNotificationTimestampsForUser (UserIdentity $user, $timestamp, array $targets=[]) | |
updateNotificationTimestamp (UserIdentity $editor, LinkTarget $target, $timestamp) | |
Public Attributes | |
const | DB_READONLY_ERROR = 'The watchlist is currently readonly.' |
Public Attributes inherited from WatchedItemStoreInterface | |
const | SORT_ASC = 'ASC' |
const | SORT_DESC = 'DESC' |
Private Attributes | |
WatchedItemStoreInterface | $actualStore |
Definition at line 30 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::__construct | ( | WatchedItemStoreInterface | $actualStore | ) |
Initialy set WatchedItemStore that will be used in cases where writing is not needed.
WatchedItemStoreInterface | $actualStore |
Definition at line 43 of file NoWriteWatchedItemStore.php.
References $actualStore.
NoWriteWatchedItemStore::addWatch | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 108 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::addWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | $targets |
Implements WatchedItemStoreInterface.
Definition at line 112 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::clearUserWatchedItems | ( | UserIdentity | $user | ) |
Queues a job that will clear the users watchlist using the Job Queue.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 147 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::clearUserWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Queues a job that will clear the users watchlist using the Job Queue.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 151 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::countUnreadNotifications | ( | UserIdentity | $user, |
$unreadLimit = null |
|||
) |
UserIdentity | $user | |
int | null | $unreadLimit |
Implements WatchedItemStoreInterface.
Definition at line 96 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::countVisitingWatchers | ( | LinkTarget | $target, |
$threshold | |||
) |
Number of page watchers who also visited a "recent" edit.
LinkTarget | $target | |
mixed | $threshold | timestamp accepted by wfTimestamp |
DBUnexpectedError | |
MWException |
Implements WatchedItemStoreInterface.
Definition at line 55 of file NoWriteWatchedItemStore.php.
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 $target, mixed $threshold), $threshold is:
|
int | null | $minimumWatchers |
Implements WatchedItemStoreInterface.
Definition at line 66 of file NoWriteWatchedItemStore.php.
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 WatchedItemStoreInterface.
Definition at line 47 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::countWatchers | ( | LinkTarget | $target | ) |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 51 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::countWatchersMultiple | ( | array | $targets, |
array | $options = [] |
||
) |
LinkTarget[] | $targets | |
array | $options | Allowed keys: 'minimumWatchers' => int |
Implements WatchedItemStoreInterface.
Definition at line 59 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::duplicateAllAssociatedEntries | ( | LinkTarget | $oldTarget, |
LinkTarget | $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 | $oldTarget | |
LinkTarget | $newTarget |
Implements WatchedItemStoreInterface.
Definition at line 100 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::duplicateEntry | ( | LinkTarget | $oldTarget, |
LinkTarget | $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 | $oldTarget | |
LinkTarget | $newTarget |
Implements WatchedItemStoreInterface.
Definition at line 104 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::getLatestNotificationTimestamp | ( | $timestamp, | |
UserIdentity | $user, | ||
LinkTarget | $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 users
Usage of this method should be limited to WatchedItem* classes
string | null | $timestamp | Value of wl_notificationtimestamp from the DB |
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 159 of file NoWriteWatchedItemStore.php.
References wfTimestampOrNull().
NoWriteWatchedItemStore::getNotificationTimestampsBatch | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | $targets |
Implements WatchedItemStoreInterface.
Definition at line 92 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::getWatchedItem | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Get an item (may be cached)
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 76 of file NoWriteWatchedItemStore.php.
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 |
Implements WatchedItemStoreInterface.
Definition at line 84 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::isWatched | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 88 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::loadWatchedItem | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Loads an item from the db.
UserIdentity | $user | |
LinkTarget | $target |
Implements WatchedItemStoreInterface.
Definition at line 80 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::removeWatch | ( | UserIdentity | $user, |
LinkTarget | $target | ||
) |
Removes an entry for the UserIdentity watching the LinkTarget Must be called separately for Subject & Talk namespaces.
UserIdentity | $user | |
LinkTarget | $target |
DBUnexpectedError | |
MWException |
Implements WatchedItemStoreInterface.
Definition at line 116 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::removeWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | $targets |
Implements WatchedItemStoreInterface.
Definition at line 155 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::resetAllNotificationTimestampsForUser | ( | UserIdentity | $user | ) |
Reset all watchlist notificaton timestamps for a user using the job queue.
UserIdentity | $user | The user to reset the timestamps for |
Implements WatchedItemStoreInterface.
Definition at line 134 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::resetNotificationTimestamp | ( | UserIdentity | $user, |
LinkTarget | $title, | ||
$force = '' , |
|||
$oldid = 0 |
|||
) |
Reset the notification timestamp of this entry.
UserIdentity | $user | |
LinkTarget | $title | |
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 WatchedItemStoreInterface.
Definition at line 138 of file NoWriteWatchedItemStore.php.
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[] | $targets | List of targets to update. Default to all targets |
Implements WatchedItemStoreInterface.
Definition at line 120 of file NoWriteWatchedItemStore.php.
NoWriteWatchedItemStore::updateNotificationTimestamp | ( | UserIdentity | $editor, |
LinkTarget | $target, | ||
$timestamp | |||
) |
UserIdentity | $editor | The editor that triggered the update. Their notification timestamp will not be updated(they have already seen it) |
LinkTarget | $target | The target to update timestamps for |
string | $timestamp | Set the update (first unseen revision) timestamp to this value |
Implements WatchedItemStoreInterface.
Definition at line 128 of file NoWriteWatchedItemStore.php.
|
private |
Definition at line 35 of file NoWriteWatchedItemStore.php.
Referenced by __construct().
const NoWriteWatchedItemStore::DB_READONLY_ERROR = 'The watchlist is currently readonly.' |
Definition at line 37 of file NoWriteWatchedItemStore.php.