MediaWiki
master
|
Storage layer class for WatchedItems. More...
Public Member Functions | |||||||
__construct (ServiceOptions $options, ILBFactory $lbFactory, JobQueueGroup $queueGroup, BagOStuff $stash, HashBagOStuff $cache, ReadOnlyMode $readOnlyMode, NamespaceInfo $nsInfo, RevisionLookup $revisionLookup, LinkBatchFactory $linkBatchFactory) | |||||||
addWatch (UserIdentity $user, $target, ?string $expiry=null) | |||||||
addWatchBatchForUser (UserIdentity $user, array $targets, ?string $expiry=null) | |||||||
Add multiple items to the user's watchlist. More... | |||||||
clearUserWatchedItems (UserIdentity $user) | |||||||
Deletes ALL watched items for the given user when under $updateRowsPerQuery entries exist. More... | |||||||
clearUserWatchedItemsUsingJobQueue (UserIdentity $user) | |||||||
Queues a job that will clear the users watchlist using the Job Queue. More... | |||||||
countExpired () | |||||||
Get the number of watchlist items that expire before the current time.
| |||||||
countUnreadNotifications (UserIdentity $user, $unreadLimit=null) | |||||||
countVisitingWatchers ( $target, $threshold) | |||||||
countVisitingWatchersMultiple (array $targetsWithVisitThresholds, $minimumWatchers=null) | |||||||
countWatchedItems (UserIdentity $user) | |||||||
countWatchers ( $target) | |||||||
countWatchersMultiple (array $targets, array $options=[]) | |||||||
duplicateAllAssociatedEntries ( $oldTarget, $newTarget) | |||||||
duplicateEntry ( $oldTarget, $newTarget) | |||||||
getLatestNotificationTimestamp ( $timestamp, UserIdentity $user, $target) | |||||||
getMaxId () | |||||||
getNotificationTimestampsBatch (UserIdentity $user, array $targets) | |||||||
getWatchedItem (UserIdentity $user, $target) | |||||||
getWatchedItemsForUser (UserIdentity $user, array $options=[]) | |||||||
isTempWatched (UserIdentity $user, $target) | |||||||
Check if the user is temporarily watching the page. More... | |||||||
isWatched (UserIdentity $user, $target) | |||||||
loadWatchedItem (UserIdentity $user, $target) | |||||||
loadWatchedItemsBatch (UserIdentity $user, array $targets) | |||||||
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) | |||||||
overrideDeferredUpdatesAddCallableUpdateCallback (callable $callback) | |||||||
Overrides the DeferredUpdates::addCallableUpdate callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined. More... | |||||||
removeExpired (int $limit, bool $deleteOrphans=false) | |||||||
Remove some number of expired watchlist items.
| |||||||
removeWatch (UserIdentity $user, $target) | |||||||
removeWatchBatchForUser (UserIdentity $user, array $titles) | |||||||
resetAllNotificationTimestampsForUser (UserIdentity $user, $timestamp=null) | |||||||
Schedule a DeferredUpdate that sets all of the "last viewed" timestamps for a given user to the same value. More... | |||||||
resetNotificationTimestamp (UserIdentity $user, $title, $force='', $oldid=0) | |||||||
setNotificationTimestampsForUser (UserIdentity $user, $timestamp, array $targets=[]) | |||||||
Set the "last viewed" timestamps for certain titles on a user's watchlist. More... | |||||||
setStatsdDataFactory (StatsdDataFactoryInterface $stats) | |||||||
updateNotificationTimestamp (UserIdentity $editor, $target, $timestamp) | |||||||
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
![]() | |
const | SORT_ASC = 'ASC' |
const | SORT_DESC = 'DESC' |
Private Member Functions | |
cache (WatchedItem $item) | |
fetchWatchedItems (IDatabase $db, UserIdentity $user, array $vars, array $options=[], $target=null) | |
Fetches either a single or all watched items for the given user, or a specific set of items. More... | |
fetchWatchedItemsForPage (IDatabase $dbw, $target) | |
getCached (UserIdentity $user, $target) | |
getCacheKey (UserIdentity $user, $target) | |
getConnectionRef ( $dbIndex) | |
getNotificationTimestamp (UserIdentity $user, $title, $item, $force, $oldid) | |
getPageSeenKey ( $target) | |
getPageSeenTimestamps (UserIdentity $user) | |
getPageSeenTimestampsKey (UserIdentity $user) | |
getTitleDbKeysGroupedByNamespace (array $titles) | |
getVisitingWatchersCondition (IDatabase $db, array $targetsWithVisitThresholds) | |
Generates condition for the query used in a batch count visiting watchers. More... | |
getWatchedItemFromRow (UserIdentity $user, $target, stdClass $row) | |
Construct a new WatchedItem given a row from watchlist/watchlist_expiry. More... | |
modifyForExpiry (array &$tables, array &$conds, array &$joinConds, IDatabase $db) | |
Helper method to deduplicate logic around queries that need to be modified if watchlist expiration is enabled. More... | |
uncache (UserIdentity $user, $target) | |
uncacheAllItemsForUser (UserIdentity $user) | |
uncacheLinkTarget ( $target) | |
uncacheTitlesForUser (UserIdentity $user, array $titles) | |
uncacheUser (UserIdentity $user) | |
updateExpiries (IDatabase $dbw, string $expiry, string $cond) | |
Update the expiries for items found with the given $cond. More... | |
updateExpiriesAfterMove (IDatabase $dbw, array $expiries, int $namespace, string $dbKey) | |
updateOrDeleteExpiries (IDatabase $dbw, int $userId, array $rows, ?string $expiry=null) | |
Insert/update expiries, or delete them if the expiry is 'infinity'. More... | |
Private Attributes | |
HashBagOStuff | $cache |
array[][] | $cacheIndex = [] |
Looks like $cacheIndex[Namespace ID][Target DB Key][User Id] => 'key' The index is needed so that on mass changes all relevant items can be un-cached. More... | |
callable null | $deferredUpdatesAddCallableUpdateCallback |
bool | $expiryEnabled |
Correlates to $wgWatchlistExpiry feature flag. More... | |
HashBagOStuff | $latestUpdateCache |
ILBFactory | $lbFactory |
LinkBatchFactory | $linkBatchFactory |
LoadBalancer | $loadBalancer |
string null | $maxExpiryDuration |
Maximum configured relative expiry. More... | |
NamespaceInfo | $nsInfo |
JobQueueGroup | $queueGroup |
ReadOnlyMode | $readOnlyMode |
RevisionLookup | $revisionLookup |
BagOStuff | $stash |
StatsdDataFactoryInterface | $stats |
int | $updateRowsPerQuery |
float | $watchlistPurgeRate |
corresponds to $wgWatchlistPurgeRate value More... | |
Storage layer class for WatchedItems.
Database interaction & caching TODO caching should be factored out into a CachingWatchedItemStore class
Definition at line 27 of file WatchedItemStore.php.
WatchedItemStore::__construct | ( | ServiceOptions | $options, |
ILBFactory | $lbFactory, | ||
JobQueueGroup | $queueGroup, | ||
BagOStuff | $stash, | ||
HashBagOStuff | $cache, | ||
ReadOnlyMode | $readOnlyMode, | ||
NamespaceInfo | $nsInfo, | ||
RevisionLookup | $revisionLookup, | ||
LinkBatchFactory | $linkBatchFactory | ||
) |
ServiceOptions | $options | |
ILBFactory | $lbFactory | |
JobQueueGroup | $queueGroup | |
BagOStuff | $stash | |
HashBagOStuff | $cache | |
ReadOnlyMode | $readOnlyMode | |
NamespaceInfo | $nsInfo | |
RevisionLookup | $revisionLookup | |
LinkBatchFactory | $linkBatchFactory |
Definition at line 137 of file WatchedItemStore.php.
References $cache, $lbFactory, $linkBatchFactory, $nsInfo, $queueGroup, $readOnlyMode, $revisionLookup, $stash, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), cache(), MediaWiki\Config\ServiceOptions\get(), and Wikimedia\Rdbms\ILBFactory\getMainLB().
WatchedItemStore::addWatch | ( | UserIdentity | $user, |
$target, | |||
?string | $expiry = null |
||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
string | null | $expiry | Optional expiry in any format acceptable to wfTimestamp(). null will not create an expiry, or leave it unchanged should one already exist. |
Implements WatchedItemStoreInterface.
Definition at line 1031 of file WatchedItemStore.php.
WatchedItemStore::addWatchBatchForUser | ( | UserIdentity | $user, |
array | $targets, | ||
?string | $expiry = null |
||
) |
Add multiple items to the user's watchlist.
If you know you're adding a single page (and/or its talk page) use self::addWatch(), since it will add the WatchedItem to the process cache.
UserIdentity | $user | |
LinkTarget[] | $targets | |
string | null | $expiry | Optional expiry in a format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Implements WatchedItemStoreInterface.
Definition at line 1067 of file WatchedItemStore.php.
|
private |
WatchedItem | $item |
Definition at line 217 of file WatchedItemStore.php.
References WatchedItem\getTarget(), and WatchedItem\getUserIdentity().
Referenced by __construct().
WatchedItemStore::clearUserWatchedItems | ( | UserIdentity | $user | ) |
Deletes ALL watched items for the given user when under $updateRowsPerQuery entries exist.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 320 of file WatchedItemStore.php.
WatchedItemStore::clearUserWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
Queues a job that will clear the users watchlist using the Job Queue.
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 407 of file WatchedItemStore.php.
References $job, and ClearUserWatchlistJob\newForUser().
WatchedItemStore::countExpired | ( | ) |
Get the number of watchlist items that expire before the current time.
Implements WatchedItemStoreInterface.
Definition at line 1823 of file WatchedItemStore.php.
WatchedItemStore::countUnreadNotifications | ( | UserIdentity | $user, |
$unreadLimit = null |
|||
) |
UserIdentity | $user | |
int | null | $unreadLimit |
Implements WatchedItemStoreInterface.
Definition at line 1621 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, and MediaWiki\User\UserIdentity\getId().
WatchedItemStore::countVisitingWatchers | ( | $target, | |
$threshold | |||
) |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
string | int | $threshold |
Implements WatchedItemStoreInterface.
Definition at line 497 of file WatchedItemStore.php.
WatchedItemStore::countVisitingWatchersMultiple | ( | array | $targetsWithVisitThresholds, |
$minimumWatchers = null |
|||
) |
array | $targetsWithVisitThresholds | array of LinkTarget[]|PageIdentity[] (not type hinted since it annoys phan) - deprecated passing LinkTarget[] since 1.36 |
int | null | $minimumWatchers |
Implements WatchedItemStoreInterface.
Definition at line 647 of file WatchedItemStore.php.
WatchedItemStore::countWatchedItems | ( | UserIdentity | $user | ) |
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 447 of file WatchedItemStore.php.
WatchedItemStore::countWatchers | ( | $target | ) |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 470 of file WatchedItemStore.php.
WatchedItemStore::countWatchersMultiple | ( | array | $targets, |
array | $options = [] |
||
) |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
array | $options | Supported options are:
|
Implements WatchedItemStoreInterface.
Definition at line 596 of file WatchedItemStore.php.
WatchedItemStore::duplicateAllAssociatedEntries | ( | $oldTarget, | |
$newTarget | |||
) |
LinkTarget | PageIdentity | $oldTarget | deprecated passing LinkTarget since 1.36 |
LinkTarget | PageIdentity | $newTarget | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 1653 of file WatchedItemStore.php.
WatchedItemStore::duplicateEntry | ( | $oldTarget, | |
$newTarget | |||
) |
LinkTarget | PageIdentity | $oldTarget | deprecated passing LinkTarget since 1.36 |
LinkTarget | PageIdentity | $newTarget | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 1671 of file WatchedItemStore.php.
References DB_PRIMARY, and Wikimedia\Rdbms\IDatabase\replace().
|
private |
Fetches either a single or all watched items for the given user, or a specific set of items.
If a $target is given, IDatabase::selectRow() is called, otherwise select(). If $wgWatchlistExpiry is enabled, expired items are not returned.
IDatabase | $db | |
UserIdentity | $user | |
array | $vars | we_expiry is added when $wgWatchlistExpiry is enabled. |
array | $options | |
LinkTarget | LinkTarget[] | PageIdentity | PageIdentity[] | null | $target | null if selecting all watched items - deprecated passing LinkTarget or LinkTarget[] since 1.36 |
Definition at line 895 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId(), LIST_AND, LIST_OR, and Wikimedia\Rdbms\Platform\ISQLPlatform\makeList().
|
private |
IDatabase | $dbw | |
LinkTarget | PageIdentity | $target |
Definition at line 1717 of file WatchedItemStore.php.
|
private |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target |
Definition at line 275 of file WatchedItemStore.php.
|
private |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target |
Definition at line 206 of file WatchedItemStore.php.
|
private |
int | $dbIndex | DB_PRIMARY or DB_REPLICA |
Definition at line 284 of file WatchedItemStore.php.
WatchedItemStore::getLatestNotificationTimestamp | ( | $timestamp, | |
UserIdentity | $user, | ||
$target | |||
) |
string | null | $timestamp | |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 1289 of file WatchedItemStore.php.
References wfTimestampOrNull().
WatchedItemStore::getMaxId | ( | ) |
|
private |
UserIdentity | $user | |
LinkTarget | PageIdentity | $title | deprecated passing LinkTarget since 1.36 |
WatchedItem | null | $item | |
string | $force | |
int | bool | $oldid | The ID of the last revision that the user viewed |
Definition at line 1558 of file WatchedItemStore.php.
References $title.
WatchedItemStore::getNotificationTimestampsBatch | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | $targets |
Implements WatchedItemStoreInterface.
Definition at line 974 of file WatchedItemStore.php.
|
private |
LinkTarget | PageIdentity | $target |
Definition at line 1546 of file WatchedItemStore.php.
|
private |
UserIdentity | $user |
Definition at line 1513 of file WatchedItemStore.php.
References $cache.
|
private |
|
private |
LinkTarget[] | PageIdentity[] | $titles |
Definition at line 1801 of file WatchedItemStore.php.
References $title.
|
private |
Generates condition for the query used in a batch count visiting watchers.
IDatabase | $db | |
array | $targetsWithVisitThresholds | array of pairs (LinkTarget|PageIdentity, last visit threshold) - deprecated passing LinkTarget since 1.36 |
Definition at line 700 of file WatchedItemStore.php.
References Wikimedia\Rdbms\Database\DbQuoter\addQuotes(), LIST_AND, LIST_OR, Wikimedia\Rdbms\Platform\ISQLPlatform\makeList(), and Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp().
WatchedItemStore::getWatchedItem | ( | UserIdentity | $user, |
$target | |||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 743 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\isRegistered().
Referenced by WatchAction\__construct().
|
private |
Construct a new WatchedItem given a row from watchlist/watchlist_expiry.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
stdClass | $row |
Definition at line 868 of file WatchedItemStore.php.
WatchedItemStore::getWatchedItemsForUser | ( | UserIdentity | $user, |
array | $options = [] |
||
) |
UserIdentity | $user | |
array | $options | Supported options are:
|
Implements WatchedItemStoreInterface.
Definition at line 816 of file WatchedItemStore.php.
WatchedItemStore::isTempWatched | ( | UserIdentity | $user, |
$target | |||
) |
Check if the user is temporarily watching the page.
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 962 of file WatchedItemStore.php.
WatchedItemStore::isWatched | ( | UserIdentity | $user, |
$target | |||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 951 of file WatchedItemStore.php.
WatchedItemStore::loadWatchedItem | ( | UserIdentity | $user, |
$target | |||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 763 of file WatchedItemStore.php.
WatchedItemStore::loadWatchedItemsBatch | ( | UserIdentity | $user, |
array | $targets | ||
) |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $targets | deprecated passing LinkTarget[] since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 774 of file WatchedItemStore.php.
References $dbr, DB_REPLICA, and MediaWiki\User\UserIdentity\isRegistered().
WatchedItemStore::maybeEnqueueWatchlistExpiryJob | ( | ) |
Probabilistically add a job to purge the expired watchlist items, if watchlist expiration is enabled, based on the value of $wgWatchlistPurgeRate.
Implements WatchedItemStoreInterface.
Definition at line 415 of file WatchedItemStore.php.
|
private |
Helper method to deduplicate logic around queries that need to be modified if watchlist expiration is enabled.
string[] | &$tables | |
array | &$conds | |
array[] | &$joinConds | |
IDatabase | $db |
Definition at line 297 of file WatchedItemStore.php.
References Wikimedia\Rdbms\Database\DbQuoter\addQuotes(), and Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp().
WatchedItemStore::mustClearWatchedItemsUsingJobQueue | ( | UserIdentity | $user | ) |
UserIdentity | $user |
Implements WatchedItemStoreInterface.
Definition at line 369 of file WatchedItemStore.php.
WatchedItemStore::overrideDeferredUpdatesAddCallableUpdateCallback | ( | callable | $callback | ) |
Overrides the DeferredUpdates::addCallableUpdate callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
callable | $callback |
MWException |
Definition at line 188 of file WatchedItemStore.php.
References $deferredUpdatesAddCallableUpdateCallback.
WatchedItemStore::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 WatchedItemStoreInterface.
Definition at line 1836 of file WatchedItemStore.php.
WatchedItemStore::removeWatch | ( | UserIdentity | $user, |
$target | |||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 1209 of file WatchedItemStore.php.
WatchedItemStore::removeWatchBatchForUser | ( | UserIdentity | $user, |
array | $titles | ||
) |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $titles | deprecated passing LinkTarget[] since 1.36 |
Implements WatchedItemStoreInterface.
Definition at line 526 of file WatchedItemStore.php.
WatchedItemStore::resetAllNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp = null |
|||
) |
Schedule a DeferredUpdate that sets all of the "last viewed" timestamps for a given user to the same value.
UserIdentity | $user | |
string | int | null | $timestamp | Value to set all timestamps to, null to clear them |
Implements WatchedItemStoreInterface.
Definition at line 1317 of file WatchedItemStore.php.
References $job, MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
WatchedItemStore::resetNotificationTimestamp | ( | UserIdentity | $user, |
$title, | |||
$force = '' , |
|||
$oldid = 0 |
|||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $title | deprecated passing LinkTarget since 1.36 |
string | $force | |
int | $oldid |
Implements WatchedItemStoreInterface.
Definition at line 1419 of file WatchedItemStore.php.
WatchedItemStore::setNotificationTimestampsForUser | ( | UserIdentity | $user, |
$timestamp, | |||
array | $targets = [] |
||
) |
Set the "last viewed" timestamps for certain titles on a user's watchlist.
If the $targets parameter is omitted or set to [], this method simply wraps resetAllNotificationTimestampsForUser(), and in that case you should instead call that method directly; support for omitting $targets is for backwards compatibility.
If $targets is omitted or set to [], timestamps will be updated for every title on the user's watchlist, and this will be done through a DeferredUpdate. If $targets is a non-empty array, only the specified titles will be updated, and this will be done immediately (not deferred).
UserIdentity | $user | |
string | int | $timestamp | Value to set the "last viewed" timestamp to (null to clear) |
LinkTarget[] | $targets | Titles to set the timestamp for; [] means the entire watchlist |
Implements WatchedItemStoreInterface.
Definition at line 1230 of file WatchedItemStore.php.
WatchedItemStore::setStatsdDataFactory | ( | StatsdDataFactoryInterface | $stats | ) |
StatsdDataFactoryInterface | $stats |
Implements StatsdAwareInterface.
Definition at line 173 of file WatchedItemStore.php.
References $stats.
|
private |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target |
Definition at line 230 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId().
|
private |
UserIdentity | $user |
Definition at line 376 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId().
|
private |
LinkTarget | PageIdentity | $target |
Definition at line 239 of file WatchedItemStore.php.
|
private |
UserIdentity | $user | |
LinkTarget[] | PageIdentity[] | $titles |
Definition at line 1814 of file WatchedItemStore.php.
References $title.
|
private |
UserIdentity | $user |
Definition at line 253 of file WatchedItemStore.php.
References MediaWiki\User\UserIdentity\getId().
|
private |
Update the expiries for items found with the given $cond.
IDatabase | $dbw | |
string | $expiry | |
string | $cond |
Definition at line 1176 of file WatchedItemStore.php.
|
private |
IDatabase | $dbw | |
array | $expiries | |
int | $namespace | |
string | $dbKey |
Definition at line 1750 of file WatchedItemStore.php.
References $res, Wikimedia\Rdbms\IDatabase\replace(), and Wikimedia\Rdbms\IDatabase\select().
WatchedItemStore::updateNotificationTimestamp | ( | UserIdentity | $editor, |
$target, | |||
$timestamp | |||
) |
UserIdentity | $editor | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
string | int | $timestamp |
Implements WatchedItemStoreInterface.
Definition at line 1345 of file WatchedItemStore.php.
|
private |
Insert/update expiries, or delete them if the expiry is 'infinity'.
IDatabase | $dbw | |
int | $userId | |
array | $rows | |
string | null | $expiry |
Definition at line 1127 of file WatchedItemStore.php.
|
private |
Definition at line 67 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Looks like $cacheIndex[Namespace ID][Target DB Key][User Id] => 'key' The index is needed so that on mass changes all relevant items can be un-cached.
For example: Clearing a users watchlist of all items or updating notification timestamps for all users watching a single target.
Definition at line 81 of file WatchedItemStore.php.
|
private |
Definition at line 86 of file WatchedItemStore.php.
Referenced by overrideDeferredUpdatesAddCallableUpdateCallback().
|
private |
Correlates to $wgWatchlistExpiry feature flag.
Definition at line 111 of file WatchedItemStore.php.
|
private |
Definition at line 72 of file WatchedItemStore.php.
|
private |
Definition at line 42 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 116 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 47 of file WatchedItemStore.php.
|
private |
Maximum configured relative expiry.
Definition at line 121 of file WatchedItemStore.php.
|
private |
Definition at line 96 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 52 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 62 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 101 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 57 of file WatchedItemStore.php.
Referenced by __construct().
|
private |
Definition at line 106 of file WatchedItemStore.php.
Referenced by setStatsdDataFactory().
|
private |
Definition at line 91 of file WatchedItemStore.php.
|
private |
corresponds to $wgWatchlistPurgeRate value
Definition at line 124 of file WatchedItemStore.php.
const WatchedItemStore::CONSTRUCTOR_OPTIONS |
Definition at line 32 of file WatchedItemStore.php.