|
| doQuery (array $userIds, $options=[], $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.
|
|
- Since
- 1.20
Definition at line 27 of file UserCache.php.
◆ __construct()
UserCache::__construct |
( |
| ) |
|
|
protected |
◆ doQuery()
UserCache::doQuery |
( |
array |
$userIds, |
|
|
|
$options = [] , |
|
|
|
$caller = '' |
|
) |
| |
Preloads user names for given list of users.
- Parameters
-
array | $userIds | List of user IDs |
array | $options | Option flags; include 'userpage' and 'usertalk' |
string | $caller | The calling method |
Definition at line 80 of file UserCache.php.
References $dbr, $name, $options, $res, $tables, $wgActorTableSchemaMigrationStage, as, cache, DB_REPLICA, NS_USER, NS_USER_TALK, queryNeeded(), SCHEMA_COMPAT_NEW, SCHEMA_COMPAT_READ_NEW, and wfGetDB().
Referenced by getProp().
◆ getProp()
UserCache::getProp |
( |
|
$userId, |
|
|
|
$prop |
|
) |
| |
◆ getUserName()
UserCache::getUserName |
( |
|
$userId, |
|
|
|
$ip |
|
) |
| |
Get the name of a user or return $ip if the user ID is 0.
- Parameters
-
- Returns
- string
- Since
- 1.22
Definition at line 70 of file UserCache.php.
References getProp().
◆ queryNeeded()
UserCache::queryNeeded |
( |
|
$uid, |
|
|
|
$type, |
|
|
array |
$options |
|
) |
| |
|
protected |
Check if a cache type is in $options and was not loaded for this user.
- Parameters
-
int | $uid | User ID |
string | $type | Cache type |
array | $options | Requested cache types |
- Returns
- bool
Definition at line 159 of file UserCache.php.
References $options, and $type.
Referenced by doQuery().
◆ singleton()
static UserCache::singleton |
( |
| ) |
|
|
static |
◆ $cache
◆ $typesCached
UserCache::$typesCached = [] |
|
protected |
The documentation for this class was generated from the following file: