MediaWiki master
MediaWiki\Watchlist\WatchedItemQueryService Class Reference

Class performing complex database queries related to WatchedItems. More...

Public Member Functions

 __construct (IConnectionProvider $dbProvider, WatchedItemStoreInterface $watchedItemStore, bool $expiryEnabled=false, int $maxQueryExecutionTime=0)
 
 getWatchedItemsForUser (UserIdentity $user, array $options=[])
 For simple listing of user's watchlist items, see WatchedItemStore::getWatchedItemsForUser.
 

Public Attributes

const FILTER_CHANGED = 'changed'
 
const FILTER_NOT_CHANGED = '!changed'
 
const SORT_ASC = 'ASC'
 
const SORT_DESC = 'DESC'
 

Detailed Description

Class performing complex database queries related to WatchedItems.

Since
1.28

Definition at line 25 of file WatchedItemQueryService.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Watchlist\WatchedItemQueryService::__construct ( IConnectionProvider $dbProvider,
WatchedItemStoreInterface $watchedItemStore,
bool $expiryEnabled = false,
int $maxQueryExecutionTime = 0 )

Definition at line 54 of file WatchedItemQueryService.php.

Member Function Documentation

◆ getWatchedItemsForUser()

MediaWiki\Watchlist\WatchedItemQueryService::getWatchedItemsForUser ( UserIdentity $user,
array $options = [] )

For simple listing of user's watchlist items, see WatchedItemStore::getWatchedItemsForUser.

Parameters
UserIdentity$user
array$optionsAllowed keys: 'sort' => string optional sorting by namespace ID and title one of the self::SORT_* constants 'namespaceIds' => int[] optional namespace IDs to filter by (defaults to all namespaces) 'limit' => int maximum number of items to return 'filter' => string optional filter, one of the self::FILTER_* constants 'from' => PageReference|LinkTarget requires 'sort' key, only return items starting from those related to the link target 'until' => PageReference|LinkTarget requires 'sort' key, only return items until those related to the link target 'startFrom' => PageReference|LinkTarget requires 'sort' key, only return items starting from those related to the link target, allows to skip some link targets specified using the form option
Returns
WatchedItem[]

Definition at line 85 of file WatchedItemQueryService.php.

References MediaWiki\User\UserIdentity\isRegistered().

Member Data Documentation

◆ FILTER_CHANGED

const MediaWiki\Watchlist\WatchedItemQueryService::FILTER_CHANGED = 'changed'

Definition at line 30 of file WatchedItemQueryService.php.

◆ FILTER_NOT_CHANGED

const MediaWiki\Watchlist\WatchedItemQueryService::FILTER_NOT_CHANGED = '!changed'

Definition at line 31 of file WatchedItemQueryService.php.

◆ SORT_ASC

const MediaWiki\Watchlist\WatchedItemQueryService::SORT_ASC = 'ASC'

Definition at line 33 of file WatchedItemQueryService.php.

◆ SORT_DESC

const MediaWiki\Watchlist\WatchedItemQueryService::SORT_DESC = 'DESC'

Definition at line 34 of file WatchedItemQueryService.php.


The documentation for this class was generated from the following file: