MediaWiki master
MediaWiki\User\UserNamePrefixSearch Class Reference

Handles searching prefixes of user names. More...

Public Member Functions

 __construct (private readonly IConnectionProvider $dbProvider, private readonly UserNameUtils $userNameUtils, private readonly HideUserUtils $hideUserUtils)
 
 search ( $audience, string $search, int $limit, int $offset=0)
 Do a prefix search of usernames and return a list of matching usernames.
 

Public Attributes

const AUDIENCE_PUBLIC = 'public'
 

Detailed Description

Handles searching prefixes of user names.

Since
1.36
Author
DannyS712

Definition at line 23 of file UserNamePrefixSearch.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserNamePrefixSearch::__construct ( private readonly IConnectionProvider $dbProvider,
private readonly UserNameUtils $userNameUtils,
private readonly HideUserUtils $hideUserUtils )

Definition at line 27 of file UserNamePrefixSearch.php.

Member Function Documentation

◆ search()

MediaWiki\User\UserNamePrefixSearch::search ( $audience,
string $search,
int $limit,
int $offset = 0 )

Do a prefix search of usernames and return a list of matching usernames.

Parameters
string | Authority$audienceEither AUDIENCE_PUBLIC or a user to show the search for
string$search
int$limit
int$offsetHow many results to offset from the beginning
Returns
string[]
Exceptions
InvalidArgumentExceptionif $audience is invalid

Definition at line 45 of file UserNamePrefixSearch.php.

Member Data Documentation

◆ AUDIENCE_PUBLIC

const MediaWiki\User\UserNamePrefixSearch::AUDIENCE_PUBLIC = 'public'

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