|
| __construct (LoggerInterface $logger, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory) |
| Uses dependency injection since 1.36.
|
|
| 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.
|
|
|
| queryNeeded ( $uid, $type, array $options) |
| Check if a cache type is in $options and was not loaded for this user.
|
|
- Since
- 1.20
Definition at line 32 of file UserCache.php.
◆ __construct()
Uses dependency injection since 1.36.
- Parameters
-
LoggerInterface | $logger | |
ILoadBalancer | $loadBalancer | |
LinkBatchFactory | $linkBatchFactory | |
Definition at line 59 of file UserCache.php.
◆ doQuery()
UserCache::doQuery |
( |
array |
$userIds, |
|
|
|
$options = [] , |
|
|
|
$caller = '' |
|
) |
| |
◆ getProp()
UserCache::getProp |
( |
|
$userId, |
|
|
|
$prop |
|
) |
| |
Get a property of a user based on their user ID.
- Parameters
-
int | $userId | User ID |
string | $prop | User property |
- Returns
- mixed|bool The property or false if the user does not exist
Definition at line 76 of file UserCache.php.
References doQuery().
Referenced by getUserName().
◆ 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 99 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 175 of file UserCache.php.
References $type.
Referenced by doQuery().
◆ singleton()
static UserCache::singleton |
( |
| ) |
|
|
static |
◆ $cache
◆ $linkBatchFactory
◆ $loadBalancer
◆ $logger
LoggerInterface UserCache::$logger |
|
private |
◆ $typesCached
UserCache::$typesCached = [] |
|
protected |
The documentation for this class was generated from the following file: