MediaWiki  REL1_19
GenderCache Class Reference

Caches user genders when needed to use correct namespace aliases. More...

List of all members.

Public Member Functions

 doLinkBatch ($data, $caller= '')
 Wrapper for doQuery that processes raw LinkBatch data.
 doQuery ($users, $caller= '')
 Preloads genders for given list of users.
 getGenderOf ($username, $caller= '')
 Returns the gender for given username.

Static Public Member Functions

static singleton ()

Protected Member Functions

 __construct ()
 getDefault ()
 Returns the default gender option in this wiki.

Protected Attributes

 $cache = array()
 $default
 $misses = 0
 $missLimit = 1000

Detailed Description

Caches user genders when needed to use correct namespace aliases.

Author:
Niklas Laxström
Since:
1.18

Definition at line 8 of file GenderCache.php.


Constructor & Destructor Documentation

GenderCache::__construct ( ) [protected]

Definition at line 25 of file GenderCache.php.


Member Function Documentation

GenderCache::doLinkBatch ( data,
caller = '' 
)

Wrapper for doQuery that processes raw LinkBatch data.

Parameters:
$data
$caller

Definition at line 80 of file GenderCache.php.

References doQuery(), and MWNamespace\hasGenderDistinction().

Here is the call graph for this function:

GenderCache::doQuery ( users,
caller = '' 
)

Preloads genders for given list of users.

Parameters:
$usersList|String: usernames
$callerString: the calling method

Definition at line 98 of file GenderCache.php.

References $comment, $dbr, $default, $res, getDefault(), and wfGetDB().

Referenced by doLinkBatch(), and getGenderOf().

Here is the call graph for this function:

Here is the caller graph for this function:

GenderCache::getDefault ( ) [protected]

Returns the default gender option in this wiki.

Returns:
String

Definition at line 31 of file GenderCache.php.

References User\getDefaultOption().

Referenced by doQuery(), and getGenderOf().

Here is the call graph for this function:

Here is the caller graph for this function:

GenderCache::getGenderOf ( username,
caller = '' 
)

Returns the gender for given username.

Parameters:
$usernameString: username
$callerString: the calling method
Returns:
String

Definition at line 44 of file GenderCache.php.

References $wgUser, doQuery(), getDefault(), User\isValidUserName(), and wfDebug().

Here is the call graph for this function:

static GenderCache::singleton ( ) [static]
Returns:
GenderCache

Definition at line 17 of file GenderCache.php.

Referenced by LinkBatch\doGenderQuery(), and Title\getNsText().

Here is the caller graph for this function:


Member Data Documentation

GenderCache::$cache = array() [protected]

Definition at line 9 of file GenderCache.php.

GenderCache::$default [protected]

Definition at line 10 of file GenderCache.php.

Referenced by doQuery().

GenderCache::$misses = 0 [protected]

Definition at line 11 of file GenderCache.php.

GenderCache::$missLimit = 1000 [protected]

Definition at line 12 of file GenderCache.php.


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