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