76 return new self(
null,
true );
91 throw new \InvalidArgumentException(
'Invalid ID' );
106 throw new \InvalidArgumentException(
'Invalid user name' );
126 return $this->user ===
null;
143 return $this->user ===
null ? 0 : $this->user->getId();
151 return $this->user ===
null ? null : $this->user->getName();
159 return $this->user ===
null || $this->user->getId() === 0 ?
'' : $this->user->getToken(
false );
179 if ( $this->user ===
null ) {
183 ( $this->
verified ?
'+' :
'-' ) .
':' .
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getName()
Get the user name, or the IP of an anonymous user.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromId( $id)
Static factory method for creation from a given user ID.
static isUsableName( $name)
Usernames which fail to pass this function will be blocked from user login and new account registrati...
load( $flags=self::READ_NORMAL)
Load the user table data for this object from the source given by mFrom.
isAnon()
Get whether the user is anonymous.