MediaWiki REL1_37
MediaWiki\User\UserNamePrefixSearch Class Reference

Handles searching prefixes of user names. More...

Collaboration diagram for MediaWiki\User\UserNamePrefixSearch:

Public Member Functions

 __construct (ILoadBalancer $loadBalancer, UserFactory $userFactory, UserNameUtils $userNameUtils)
 
 search ( $audience, string $search, int $limit, int $offset=0)
 Do a prefix search of user names and return a list of matching user names.
 

Private Attributes

ILoadBalancer $loadBalancer
 
UserFactory $userFactory
 
UserNameUtils $userNameUtils
 

Detailed Description

Handles searching prefixes of user names.

Note
There are two classes called UserNamePrefixSearch. You should use this first one, in namespace MediaWiki\User, which is a service. \UserNamePrefixSearch is a deprecated static wrapper that forwards to the global service.
Since
1.36 as a service in the current namespace
Author
DannyS712

Definition at line 39 of file UserNamePrefixSearch.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserNamePrefixSearch::__construct ( ILoadBalancer  $loadBalancer,
UserFactory  $userFactory,
UserNameUtils  $userNameUtils 
)
Parameters
ILoadBalancer$loadBalancer
UserFactory$userFactory
UserNameUtils$userNameUtils

Definition at line 58 of file UserNamePrefixSearch.php.

References MediaWiki\User\UserNamePrefixSearch\$loadBalancer, MediaWiki\User\UserNamePrefixSearch\$userFactory, and MediaWiki\User\UserNamePrefixSearch\$userNameUtils.

Member Function Documentation

◆ search()

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

Do a prefix search of user names and return a list of matching user names.

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

Definition at line 79 of file UserNamePrefixSearch.php.

References wfDeprecated().

Member Data Documentation

◆ $loadBalancer

ILoadBalancer MediaWiki\User\UserNamePrefixSearch::$loadBalancer
private
Initial value:
=
public const AUDIENCE_PUBLIC 'public'

Definition at line 45 of file UserNamePrefixSearch.php.

Referenced by MediaWiki\User\UserNamePrefixSearch\__construct().

◆ $userFactory

UserFactory MediaWiki\User\UserNamePrefixSearch::$userFactory
private

◆ $userNameUtils

UserNameUtils MediaWiki\User\UserNamePrefixSearch::$userNameUtils
private

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