Merge "Perform a permission check on the title when changing the page language"
[lhc/web/wiklou.git] / includes / WatchedItemQueryServiceExtension.php
1 <?php
2
3 use Wikimedia\Rdbms\ResultWrapper;
4 use Wikimedia\Rdbms\IDatabase;
5
6 /**
7 * Extension mechanism for WatchedItemQueryService
8 *
9 * @since 1.29
10 *
11 * @file
12 * @ingroup Watchlist
13 *
14 * @license GNU GPL v2+
15 */
16 interface WatchedItemQueryServiceExtension {
17
18 /**
19 * Modify the WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
20 * query before it's made.
21 *
22 * @warning Any joins added *must* join on a unique key of the target table
23 * unless you really know what you're doing.
24 * @param User $user
25 * @param array $options Options from
26 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
27 * @param IDatabase $db Database connection being used for the query
28 * @param array &$tables Tables for Database::select()
29 * @param array &$fields Fields for Database::select()
30 * @param array &$conds Conditions for Database::select()
31 * @param array &$dbOptions Options for Database::select()
32 * @param array &$joinConds Join conditions for Database::select()
33 */
34 public function modifyWatchedItemsWithRCInfoQuery( User $user, array $options, IDatabase $db,
35 array &$tables, array &$fields, array &$conds, array &$dbOptions, array &$joinConds
36 );
37
38 /**
39 * Modify the results from WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
40 * before they're returned.
41 *
42 * @param User $user
43 * @param array $options Options from
44 * WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo()
45 * @param IDatabase $db Database connection being used for the query
46 * @param array &$items array of pairs ( WatchedItem $watchedItem, string[] $recentChangeInfo ).
47 * May be truncated if necessary, in which case $startFrom must be updated.
48 * @param ResultWrapper|bool $res Database query result
49 * @param array|null &$startFrom Continuation value. If you truncate $items, set this to
50 * [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ] from the first item
51 * removed.
52 */
53 public function modifyWatchedItemsWithRCInfo( User $user, array $options, IDatabase $db,
54 array &$items, $res, &$startFrom
55 );
56
57 }