MediaWiki  master
UserIdentityValue.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\User;
24 
26 
32 class UserIdentityValue implements UserIdentity {
33 
37  private $id;
38 
42  private $name;
43 
47  private $actor;
48 
54  public function __construct( $id, $name, $actor ) {
55  Assert::parameterType( 'integer', $id, '$id' );
56  Assert::parameterType( 'string', $name, '$name' );
57  Assert::parameterType( 'integer', $actor, '$actor' );
58 
59  $this->id = $id;
60  $this->name = $name;
61  $this->actor = $actor;
62  }
63 
67  public function getId() {
68  return $this->id;
69  }
70 
74  public function getName() {
75  return $this->name;
76  }
77 
81  public function getActorId() {
82  return $this->actor;
83  }
84 
91  public function equals( UserIdentity $user ) {
92  // XXX it's not clear whether central ID providers are supposed to obey this
93  return $this->getName() === $user->getName();
94  }
95 
103  public function isRegistered() {
104  return $this->getId() != 0;
105  }
106 }
Interface for objects representing user identity.
Value object representing a user&#39;s identity.