MediaWiki 1.42.0
|
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 42 of file GenderCache.php.
MediaWiki\Cache\GenderCache::__construct | ( | NamespaceInfo | $nsInfo = null, |
IConnectionProvider | $dbProvider = null, | ||
UserOptionsLookup | $userOptionsLookup = null ) |
Definition at line 53 of file GenderCache.php.
References MediaWiki\MediaWikiServices\getInstance().
MediaWiki\Cache\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 109 of file GenderCache.php.
References MediaWiki\Cache\GenderCache\doQuery().
MediaWiki\Cache\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 142 of file GenderCache.php.
References MediaWiki\Cache\GenderCache\$default, and MediaWiki\Cache\GenderCache\getDefault().
Referenced by MediaWiki\Cache\GenderCache\doLinkBatch(), MediaWiki\Cache\GenderCache\doTitlesArray(), and MediaWiki\Cache\GenderCache\getGenderOf().
MediaWiki\Cache\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 126 of file GenderCache.php.
References MediaWiki\Cache\GenderCache\doQuery().
|
protected |
Get the default gender option on this wiki.
Definition at line 68 of file GenderCache.php.
References MediaWiki\Cache\GenderCache\$default.
Referenced by MediaWiki\Cache\GenderCache\doQuery(), and MediaWiki\Cache\GenderCache\getGenderOf().
MediaWiki\Cache\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 80 of file GenderCache.php.
References MediaWiki\Cache\GenderCache\doQuery(), MediaWiki\Cache\GenderCache\getDefault(), getUser(), and wfDebug().
|
protected |
Definition at line 43 of file GenderCache.php.
|
protected |
Definition at line 44 of file GenderCache.php.
Referenced by MediaWiki\Cache\GenderCache\doQuery(), and MediaWiki\Cache\GenderCache\getDefault().
|
protected |
Definition at line 45 of file GenderCache.php.
|
protected |
Definition at line 47 of file GenderCache.php.