MediaWiki REL1_35
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)
 Stable to call.
 
 equals (UserIdentity $user)
 
 getActorId ()
 
 getId ()
 
 getName ()
 
 isRegistered ()
 

Private Attributes

int $actor
 
int $id
 
string $name
 

Detailed Description

Value object representing a user's identity.

@newable

Since
1.31

Definition at line 34 of file UserIdentityValue.php.

Constructor & Destructor Documentation

◆ __construct()

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

Stable to call.

Parameters
int$id
string$name
int$actor

Definition at line 58 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 95 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 85 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 71 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 78 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 107 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: