MediaWiki  REL1_22
UserCache Class Reference

List of all members.

Public Member Functions

 doQuery (array $userIds, $options=array(), $caller= '')
 Preloads user names for given list of users.
 getProp ($userId, $prop)
 Get a property of a user based on their user ID.
 getUserName ($userId, $ip)
 Get the name of a user or return $ip if the user ID is 0.

Static Public Member Functions

static singleton ()

Protected Member Functions

 __construct ()
 queryNeeded ($uid, $type, array $options)
 Check if a cache type is in $options and was not loaded for this user.

Protected Attributes

 $cache = array()
 $typesCached = array()

Detailed Description

Since:
1.20

Definition at line 27 of file UserCache.php.


Constructor & Destructor Documentation

UserCache::__construct ( ) [protected]

Definition at line 42 of file UserCache.php.


Member Function Documentation

UserCache::doQuery ( array userIds,
options = array(),
caller = '' 
)

Preloads user names for given list of users.

Parameters:
array$userIdsList of user IDs
array$optionsOption flags; include 'userpage' and 'usertalk'
string$callerthe calling method

Definition at line 78 of file UserCache.php.

References $comment, $dbr, $lb, $name, $options, $res, array(), as, cache, queryNeeded(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by getProp().

UserCache::getProp ( userId,
prop 
)

Get a property of a user based on their user ID.

Parameters:
$userIdinteger User ID
string$propUser property
Returns:
mixed The property or false if the user does not exist

Definition at line 51 of file UserCache.php.

References array(), cache, doQuery(), and wfDebug().

Referenced by getUserName().

UserCache::getUserName ( userId,
ip 
)

Get the name of a user or return $ip if the user ID is 0.

Parameters:
integer$userId
string$ip
Since:
1.22

Definition at line 68 of file UserCache.php.

References getProp().

UserCache::queryNeeded ( uid,
type,
array options 
) [protected]

Check if a cache type is in $options and was not loaded for this user.

Parameters:
$uidinteger user ID
string$typeCache type
array$optionsRequested cache types
Returns:
bool

Definition at line 144 of file UserCache.php.

Referenced by doQuery().

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

Definition at line 34 of file UserCache.php.

Referenced by ImageListPager\doBatchLookups().


Member Data Documentation

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

Definition at line 28 of file UserCache.php.

UserCache::$typesCached = array() [protected]

Definition at line 29 of file UserCache.php.


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