MediaWiki REL1_41
|
Look up "gender" user preference. More...
Public Member Functions | |
__construct (NamespaceInfo $nsInfo=null, IConnectionProvider $dbProvider=null, UserOptionsLookup $userOptionsLookup=null) | |
doLinkBatch (array $data, $caller='') | |
Wrapper for doQuery that processes raw LinkBatch data. | |
doQuery ( $users, $caller='') | |
Preload gender option for multiple user names. | |
doTitlesArray ( $titles, $caller='') | |
Wrapper for doQuery that processes a title array. | |
getGenderOf ( $username, $caller='') | |
Get the gender option for given username. | |
Protected Member Functions | |
getDefault () | |
Get the default gender option on this wiki. | |
Protected Attributes | |
$cache = [] | |
$default = null | |
$misses = 0 | |
$missLimit = 1000 | |
Look up "gender" user preference.
This primarily used in MediaWiki\Title\MediaWikiTitleCodec for title formatting of pages in gendered namespace aliases, and in CoreParserFunctions for the {{gender:}}
parser function.
Definition at line 39 of file GenderCache.php.
GenderCache::__construct | ( | NamespaceInfo | $nsInfo = null, |
IConnectionProvider | $dbProvider = null, | ||
UserOptionsLookup | $userOptionsLookup = null ) |
Definition at line 50 of file GenderCache.php.
GenderCache::doLinkBatch | ( | array | $data, |
$caller = '' ) |
Wrapper for doQuery that processes raw LinkBatch data.
array<int,array<string,mixed>> | $data | |
string | null | $caller |
Definition at line 106 of file GenderCache.php.
References doQuery().
GenderCache::doQuery | ( | $users, | |
$caller = '' ) |
Preload gender option for multiple user names.
string[] | string | $users | Usernames |
string | null | $caller | Calling method for database profiling |
Definition at line 139 of file GenderCache.php.
References $default, and getDefault().
Referenced by doLinkBatch(), doTitlesArray(), and getGenderOf().
GenderCache::doTitlesArray | ( | $titles, | |
$caller = '' ) |
Wrapper for doQuery that processes a title array.
LinkTarget[] | $titles | |
string | null | $caller | Calling method for database profiling |
Definition at line 123 of file GenderCache.php.
References doQuery().
|
protected |
Get the default gender option on this wiki.
Definition at line 65 of file GenderCache.php.
Referenced by doQuery(), and getGenderOf().
GenderCache::getGenderOf | ( | $username, | |
$caller = '' ) |
Get the gender option for given username.
string | UserIdentity | $username | |
string | null | $caller | Calling method for database profiling |
Definition at line 77 of file GenderCache.php.
References doQuery(), getDefault(), getUser(), and wfDebug().
|
protected |
Definition at line 40 of file GenderCache.php.
|
protected |
Definition at line 41 of file GenderCache.php.
Referenced by doQuery().
|
protected |
Definition at line 42 of file GenderCache.php.
|
protected |
Definition at line 44 of file GenderCache.php.