Merge "Update searchdisabled message with docs and better link target"
[mediawiki.git] / includes / watchlist / WatchedItemQueryServiceExtension.php
blobef100867b9d9b23a167c6d8eb187dd519da9d0b3
1 <?php
3 namespace MediaWiki\Watchlist;
5 use MediaWiki\User\UserIdentity;
6 use Wikimedia\Rdbms\IReadableDatabase;
7 use Wikimedia\Rdbms\IResultWrapper;
9 /**
10 * Extension mechanism for WatchedItemQueryService
12 * @since 1.29
14 * @file
15 * @ingroup Watchlist
17 * @license GPL-2.0-or-later
19 interface WatchedItemQueryServiceExtension {
21 /**
22 * Modify the WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
23 * query before it's made.
25 * @warning Any joins added *must* join on a unique key of the target table
26 * unless you really know what you're doing.
27 * @param UserIdentity $user
28 * @param array $options Options from
29 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
30 * @param IReadableDatabase $db Database connection being used for the query
31 * @param array &$tables Tables for Database::select()
32 * @param array &$fields Fields for Database::select()
33 * @param array &$conds Conditions for Database::select()
34 * @param array &$dbOptions Options for Database::select()
35 * @param array &$joinConds Join conditions for Database::select()
37 public function modifyWatchedItemsWithRCInfoQuery( UserIdentity $user, array $options,
38 IReadableDatabase $db, array &$tables, array &$fields, array &$conds, array &$dbOptions,
39 array &$joinConds
42 /**
43 * Modify the results from WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
44 * before they're returned.
46 * @param UserIdentity $user
47 * @param array $options Options from
48 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
49 * @param IReadableDatabase $db Database connection being used for the query
50 * @param array &$items array of pairs ( WatchedItem $watchedItem, string[] $recentChangeInfo ).
51 * May be truncated if necessary, in which case $startFrom must be updated.
52 * @param IResultWrapper|bool $res Database query result
53 * @param array|null &$startFrom Continuation value. If you truncate $items, set this to
54 * [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ] from the first item
55 * removed.
57 public function modifyWatchedItemsWithRCInfo( UserIdentity $user, array $options, IReadableDatabase $db,
58 array &$items, $res, &$startFrom
62 /** @deprecated class alias since 1.43 */
63 class_alias( WatchedItemQueryServiceExtension::class, 'WatchedItemQueryServiceExtension' );