MediaWiki REL1_39
MediaWiki\User\ActorCache Class Reference

Public Member Functions

 __construct (int $maxSize)
 
 add (int $actorId, UserIdentity $actor)
 Add $actor with $actorId to the cache.
 
 clear ()
 Remove everything from the cache.
 
 getActor (string $keyType, $keyValue)
 Get user identity which has $keyType equal to $keyValue.
 
 getActorId (string $keyType, $keyValue)
 Get actor ID of the user which has $keyType equal to $keyValue.
 
 remove (UserIdentity $actor)
 Remove $actor from cache.
 

Detailed Description

Definition at line 36 of file ActorCache.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\ActorCache::__construct ( int $maxSize)
Parameters
int$maxSizehold up to this many UserIdentity values

Definition at line 60 of file ActorCache.php.

Member Function Documentation

◆ add()

MediaWiki\User\ActorCache::add ( int $actorId,
UserIdentity $actor )

Add $actor with $actorId to the cache.

Parameters
int$actorId
UserIdentity$actor

Definition at line 89 of file ActorCache.php.

References MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), and MediaWiki\DAO\WikiAwareEntity\getWikiId().

◆ clear()

MediaWiki\User\ActorCache::clear ( )

Remove everything from the cache.

Access: internal

Definition at line 127 of file ActorCache.php.

◆ getActor()

MediaWiki\User\ActorCache::getActor ( string $keyType,
$keyValue )

Get user identity which has $keyType equal to $keyValue.

Parameters
string$keyTypeone of self::KEY_* constants.
string | int$keyValue
Returns
UserIdentity|null

Definition at line 70 of file ActorCache.php.

◆ getActorId()

MediaWiki\User\ActorCache::getActorId ( string $keyType,
$keyValue )

Get actor ID of the user which has $keyType equal to $keyValue.

Parameters
string$keyTypeone of self::KEY_* constants.
string | int$keyValue
Returns
int|null

Definition at line 80 of file ActorCache.php.

◆ remove()

MediaWiki\User\ActorCache::remove ( UserIdentity $actor)

Remove $actor from cache.

Parameters
UserIdentity$actor

Definition at line 108 of file ActorCache.php.


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