MediaWiki REL1_40
WatchedItemQueryService Class Reference

Public Member Functions

 __construct (ILoadBalancer $loadBalancer, CommentStore $commentStore, WatchedItemStoreInterface $watchedItemStore, HookContainer $hookContainer, UserOptionsLookup $userOptionsLookup, bool $expiryEnabled=false, int $maxQueryExecutionTime=0)
 
 getWatchedItemsForUser (UserIdentity $user, array $options=[])
 For simple listing of user's watchlist items, see WatchedItemStore::getWatchedItemsForUser.
 
 getWatchedItemsWithRecentChangeInfo (User $user, array $options=[], &$startFrom=null)
 

Public Attributes

const DIR_NEWER = 'newer'
 
const DIR_OLDER = 'older'
 
const FILTER_ANON = 'anon'
 
const FILTER_AUTOPATROLLED = 'autopatrolled'
 
const FILTER_BOT = 'bot'
 
const FILTER_CHANGED = 'changed'
 
const FILTER_MINOR = 'minor'
 
const FILTER_NOT_ANON = '!anon'
 
const FILTER_NOT_AUTOPATROLLED = '!autopatrolled'
 
const FILTER_NOT_BOT = '!bot'
 
const FILTER_NOT_CHANGED = '!changed'
 
const FILTER_NOT_MINOR = '!minor'
 
const FILTER_NOT_PATROLLED = '!patrolled'
 
const FILTER_NOT_UNREAD = '!unread'
 
const FILTER_PATROLLED = 'patrolled'
 
const FILTER_UNREAD = 'unread'
 
const INCLUDE_AUTOPATROL_INFO = 'autopatrol'
 
const INCLUDE_COMMENT = 'comment'
 
const INCLUDE_FLAGS = 'flags'
 
const INCLUDE_LOG_INFO = 'loginfo'
 
const INCLUDE_PATROL_INFO = 'patrol'
 
const INCLUDE_SIZES = 'sizes'
 
const INCLUDE_TAGS = 'tags'
 
const INCLUDE_USER = 'user'
 
const INCLUDE_USER_ID = 'userid'
 
const SORT_ASC = 'ASC'
 
const SORT_DESC = 'DESC'
 

Detailed Description

Definition at line 25 of file WatchedItemQueryService.php.

Constructor & Destructor Documentation

◆ __construct()

WatchedItemQueryService::__construct ( ILoadBalancer $loadBalancer,
CommentStore $commentStore,
WatchedItemStoreInterface $watchedItemStore,
HookContainer $hookContainer,
UserOptionsLookup $userOptionsLookup,
bool $expiryEnabled = false,
int $maxQueryExecutionTime = 0 )

Definition at line 91 of file WatchedItemQueryService.php.

Member Function Documentation

◆ getWatchedItemsForUser()

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' => LinkTarget requires 'sort' key, only return items starting from those related to the link target 'until' => LinkTarget requires 'sort' key, only return items until those related to the link target 'startFrom' => 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 302 of file WatchedItemQueryService.php.

References $res, and MediaWiki\User\UserIdentity\isRegistered().

◆ getWatchedItemsWithRecentChangeInfo()

WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo ( User $user,
array $options = [],
& $startFrom = null )
Parameters
User$user
array$optionsAllowed keys: 'includeFields' => string[] RecentChange fields to be included in the result, self::INCLUDE_* constants should be used 'filters' => string[] optional filters to narrow down resulted items 'namespaceIds' => int[] optional namespace IDs to filter by (defaults to all namespaces) 'allRevisions' => bool return multiple revisions of the same page if true, only the most recent if false (default) 'rcTypes' => int[] which types of RecentChanges to include (defaults to all types), allowed values: RC_EDIT, RC_NEW, RC_LOG, RC_EXTERNAL, RC_CATEGORIZE 'onlyByUser' => string only list changes by a specified user 'notByUser' => string do not include changes by a specified user 'dir' => string in which direction to enumerate, accepted values:
  • DIR_OLDER list newest first
  • DIR_NEWER list oldest first 'start' => string (format accepted by wfTimestamp) requires 'dir' option, timestamp to start enumerating from 'end' => string (format accepted by wfTimestamp) requires 'dir' option, timestamp to end enumerating 'watchlistOwner' => UserIdentity user whose watchlist items should be listed if different than the one specified with $user param, requires 'watchlistOwnerToken' option 'watchlistOwnerToken' => string a watchlist token used to access another user's watchlist, used with 'watchlistOwnerToken' option 'limit' => int maximum numbers of items to return 'usedInGenerator' => bool include only RecentChange id field required by the generator ('rc_cur_id' or 'rc_this_oldid') if true, or all id fields ('rc_cur_id', 'rc_this_oldid', 'rc_last_oldid') if false (default)
array | null&$startFromContinuation value: [ string $rcTimestamp, int $rcId ]
Returns
array[] Array of pairs ( WatchedItem $watchedItem, string[] $recentChangeInfo ), where $recentChangeInfo contains the following keys:
  • 'rc_id',
  • 'rc_namespace',
  • 'rc_title',
  • 'rc_timestamp',
  • 'rc_type',
  • 'rc_deleted', Additional keys could be added by specifying the 'includeFields' option

Definition at line 170 of file WatchedItemQueryService.php.

References $res, RC_CATEGORIZE, RC_EDIT, RC_EXTERNAL, RC_LOG, and RC_NEW.

Member Data Documentation

◆ DIR_NEWER

const WatchedItemQueryService::DIR_NEWER = 'newer'

Definition at line 28 of file WatchedItemQueryService.php.

◆ DIR_OLDER

const WatchedItemQueryService::DIR_OLDER = 'older'

Definition at line 27 of file WatchedItemQueryService.php.

◆ FILTER_ANON

const WatchedItemQueryService::FILTER_ANON = 'anon'

Definition at line 47 of file WatchedItemQueryService.php.

◆ FILTER_AUTOPATROLLED

const WatchedItemQueryService::FILTER_AUTOPATROLLED = 'autopatrolled'

Definition at line 51 of file WatchedItemQueryService.php.

◆ FILTER_BOT

const WatchedItemQueryService::FILTER_BOT = 'bot'

Definition at line 45 of file WatchedItemQueryService.php.

◆ FILTER_CHANGED

const WatchedItemQueryService::FILTER_CHANGED = 'changed'

Definition at line 55 of file WatchedItemQueryService.php.

◆ FILTER_MINOR

const WatchedItemQueryService::FILTER_MINOR = 'minor'

Definition at line 43 of file WatchedItemQueryService.php.

◆ FILTER_NOT_ANON

const WatchedItemQueryService::FILTER_NOT_ANON = '!anon'

Definition at line 48 of file WatchedItemQueryService.php.

◆ FILTER_NOT_AUTOPATROLLED

const WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED = '!autopatrolled'

Definition at line 52 of file WatchedItemQueryService.php.

◆ FILTER_NOT_BOT

const WatchedItemQueryService::FILTER_NOT_BOT = '!bot'

Definition at line 46 of file WatchedItemQueryService.php.

◆ FILTER_NOT_CHANGED

const WatchedItemQueryService::FILTER_NOT_CHANGED = '!changed'

Definition at line 56 of file WatchedItemQueryService.php.

◆ FILTER_NOT_MINOR

const WatchedItemQueryService::FILTER_NOT_MINOR = '!minor'

Definition at line 44 of file WatchedItemQueryService.php.

◆ FILTER_NOT_PATROLLED

const WatchedItemQueryService::FILTER_NOT_PATROLLED = '!patrolled'

Definition at line 50 of file WatchedItemQueryService.php.

◆ FILTER_NOT_UNREAD

const WatchedItemQueryService::FILTER_NOT_UNREAD = '!unread'

Definition at line 54 of file WatchedItemQueryService.php.

◆ FILTER_PATROLLED

const WatchedItemQueryService::FILTER_PATROLLED = 'patrolled'

Definition at line 49 of file WatchedItemQueryService.php.

◆ FILTER_UNREAD

const WatchedItemQueryService::FILTER_UNREAD = 'unread'

Definition at line 53 of file WatchedItemQueryService.php.

◆ INCLUDE_AUTOPATROL_INFO

const WatchedItemQueryService::INCLUDE_AUTOPATROL_INFO = 'autopatrol'

Definition at line 35 of file WatchedItemQueryService.php.

◆ INCLUDE_COMMENT

const WatchedItemQueryService::INCLUDE_COMMENT = 'comment'

Definition at line 33 of file WatchedItemQueryService.php.

◆ INCLUDE_FLAGS

const WatchedItemQueryService::INCLUDE_FLAGS = 'flags'

Definition at line 30 of file WatchedItemQueryService.php.

◆ INCLUDE_LOG_INFO

const WatchedItemQueryService::INCLUDE_LOG_INFO = 'loginfo'

Definition at line 37 of file WatchedItemQueryService.php.

◆ INCLUDE_PATROL_INFO

const WatchedItemQueryService::INCLUDE_PATROL_INFO = 'patrol'

Definition at line 34 of file WatchedItemQueryService.php.

◆ INCLUDE_SIZES

const WatchedItemQueryService::INCLUDE_SIZES = 'sizes'

Definition at line 36 of file WatchedItemQueryService.php.

◆ INCLUDE_TAGS

const WatchedItemQueryService::INCLUDE_TAGS = 'tags'

Definition at line 38 of file WatchedItemQueryService.php.

◆ INCLUDE_USER

const WatchedItemQueryService::INCLUDE_USER = 'user'

Definition at line 31 of file WatchedItemQueryService.php.

◆ INCLUDE_USER_ID

const WatchedItemQueryService::INCLUDE_USER_ID = 'userid'

Definition at line 32 of file WatchedItemQueryService.php.

◆ SORT_ASC

const WatchedItemQueryService::SORT_ASC = 'ASC'

Definition at line 58 of file WatchedItemQueryService.php.

◆ SORT_DESC

const WatchedItemQueryService::SORT_DESC = 'DESC'

Definition at line 59 of file WatchedItemQueryService.php.


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