3 use MediaWiki\User\UserIdentity
;
4 use Wikimedia\Rdbms\IResultWrapper
;
5 use Wikimedia\Rdbms\IDatabase
;
8 * Extension mechanism for WatchedItemQueryService
15 * @license GPL-2.0-or-later
17 interface WatchedItemQueryServiceExtension
{
20 * Modify the WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
21 * query before it's made.
23 * @warning Any joins added *must* join on a unique key of the target table
24 * unless you really know what you're doing.
25 * @param UserIdentity $user
26 * @param array $options Options from
27 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
28 * @param IDatabase $db Database connection being used for the query
29 * @param array &$tables Tables for Database::select()
30 * @param array &$fields Fields for Database::select()
31 * @param array &$conds Conditions for Database::select()
32 * @param array &$dbOptions Options for Database::select()
33 * @param array &$joinConds Join conditions for Database::select()
35 public function modifyWatchedItemsWithRCInfoQuery( UserIdentity
$user, array $options,
36 IDatabase
$db, array &$tables, array &$fields, array &$conds, array &$dbOptions,
41 * Modify the results from WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
42 * before they're returned.
44 * @param UserIdentity $user
45 * @param array $options Options from
46 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
47 * @param IDatabase $db Database connection being used for the query
48 * @param array &$items array of pairs ( WatchedItem $watchedItem, string[] $recentChangeInfo ).
49 * May be truncated if necessary, in which case $startFrom must be updated.
50 * @param IResultWrapper|bool $res Database query result
51 * @param array|null &$startFrom Continuation value. If you truncate $items, set this to
52 * [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ] from the first item
55 public function modifyWatchedItemsWithRCInfo( UserIdentity
$user, array $options, IDatabase
$db,
56 array &$items, $res, &$startFrom