MediaWiki  1.34.0
MediaWiki\User\UserIdentityValue Class Reference

Value object representing a user's identity. More...

Inheritance diagram for MediaWiki\User\UserIdentityValue:
Collaboration diagram for MediaWiki\User\UserIdentityValue:

Public Member Functions

 __construct ( $id, $name, $actor)
 
 equals (UserIdentity $user)
 
 getActorId ()
 
 getId ()
 
 getName ()
 
 isRegistered ()
 

Private Attributes

int $actor
 
int $id
 
string $name
 

Detailed Description

Value object representing a user's identity.

Since
1.31

Definition at line 32 of file UserIdentityValue.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserIdentityValue::__construct (   $id,
  $name,
  $actor 
)
Parameters
int$id
string$name
int$actor

Definition at line 54 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentityValue\$actor, MediaWiki\User\UserIdentityValue\$id, and MediaWiki\User\UserIdentityValue\$name.

Member Function Documentation

◆ equals()

MediaWiki\User\UserIdentityValue::equals ( UserIdentity  $user)
Since
1.32
Parameters
UserIdentity$user
Returns
bool

Implements MediaWiki\User\UserIdentity.

Definition at line 91 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentity\getName(), and MediaWiki\User\UserIdentityValue\getName().

◆ getActorId()

MediaWiki\User\UserIdentityValue::getActorId ( )
Returns
int The user's actor ID. May be 0 if no actor ID has been assigned.

Implements MediaWiki\User\UserIdentity.

Definition at line 81 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentityValue\$actor.

◆ getId()

MediaWiki\User\UserIdentityValue::getId ( )
Returns
int The user ID. May be 0 for anonymous users or for users with no local account.

Implements MediaWiki\User\UserIdentity.

Definition at line 67 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentityValue\$id.

Referenced by MediaWiki\User\UserIdentityValue\isRegistered().

◆ getName()

MediaWiki\User\UserIdentityValue::getName ( )
Returns
string The user's logical name. May be an IPv4 or IPv6 address for anonymous users.

Implements MediaWiki\User\UserIdentity.

Definition at line 74 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentityValue\$name.

Referenced by MediaWiki\User\UserIdentityValue\equals().

◆ isRegistered()

MediaWiki\User\UserIdentityValue::isRegistered ( )
Since
1.34
Returns
bool True if user is registered on this wiki, i.e., has a user ID. False if user is anonymous or has no local account (which can happen when importing). This is equivalent to getId() != 0 and is provided for code readability.

Implements MediaWiki\User\UserIdentity.

Definition at line 103 of file UserIdentityValue.php.

References MediaWiki\User\UserIdentityValue\getId().

Member Data Documentation

◆ $actor

int MediaWiki\User\UserIdentityValue::$actor
private

◆ $id

int MediaWiki\User\UserIdentityValue::$id
private

◆ $name

string MediaWiki\User\UserIdentityValue::$name
private

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