MediaWiki fundraising/REL1_35
MediaWiki\User\UserFactory Class Reference

Creates User objects. More...

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

Public Member Functions

 __construct (UserNameUtils $userNameUtils)
 
 newAnonymous ( $ip=null)
 Returns a new anonymous User based on ip.
 
 newFromActorId (int $actorId)
 
 newFromAnyId (?int $userId, ?string $userName, ?int $actorId, $dbDomain=false)
 
 newFromConfirmationCode (string $confirmationCode, int $flags=self::READ_NORMAL)
 
 newFromId (int $id)
 
 newFromName (string $name, string $validate=UserNameUtils::RIGOR_VALID)
 
 newFromUserIdentity (UserIdentity $userIdentity)
 

Private Attributes

UserNameUtils $userNameUtils
 

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_LOCKING = self::READ_LATEST | 2
 Constants for object loading bitfield flags (higher => higher QoS)
 
const READ_NONE = -1
 

Detailed Description

Creates User objects.

For now, there is nothing interesting in this class. It is meant for preventing static User methods causing problems in unit tests.

Since
1.35

Definition at line 36 of file UserFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserFactory::__construct ( UserNameUtils $userNameUtils)
Parameters
UserNameUtils$userNameUtils

Definition at line 46 of file UserFactory.php.

References MediaWiki\User\UserFactory\$userNameUtils.

Member Function Documentation

◆ newAnonymous()

MediaWiki\User\UserFactory::newAnonymous ( $ip = null)

Returns a new anonymous User based on ip.

Since
1.35
Parameters
string | null$ipIP address
Returns
User

Definition at line 72 of file UserFactory.php.

References User\isIP(), MediaWiki\User\UserFactory\newFromName(), and MediaWiki\User\UserNameUtils\RIGOR_NONE.

◆ newFromActorId()

MediaWiki\User\UserFactory::newFromActorId ( int $actorId)
See also
User::newFromActorId
Parameters
int$actorId
Returns
User

Definition at line 100 of file UserFactory.php.

◆ newFromAnyId()

MediaWiki\User\UserFactory::newFromAnyId ( ?int $userId,
?string $userName,
?int $actorId,
$dbDomain = false )
See also
User::newFromAnyId
Parameters
?int$userId
?string$userName
?int$actorId
bool | string$dbDomain
Returns
User

Definition at line 129 of file UserFactory.php.

◆ newFromConfirmationCode()

MediaWiki\User\UserFactory::newFromConfirmationCode ( string $confirmationCode,
int $flags = self::READ_NORMAL )
See also
User::newFromConfirmationCode
Parameters
string$confirmationCode
int$flags
Returns
User|null

Definition at line 144 of file UserFactory.php.

◆ newFromId()

MediaWiki\User\UserFactory::newFromId ( int $id)
See also
User::newFromId
Parameters
int$id
Returns
User

Definition at line 91 of file UserFactory.php.

◆ newFromName()

MediaWiki\User\UserFactory::newFromName ( string $name,
string $validate = UserNameUtils::RIGOR_VALID )
See also
User::newFromName
Parameters
string$name
string$validateValidation strategy, one of the UserNameUtils::RIGOR_* constants. For no validation, use UserNameUtils::RIGOR_NONE.
Returns
User|bool

Definition at line 57 of file UserFactory.php.

References User\newFromName().

Referenced by MediaWiki\User\UserFactory\newAnonymous().

◆ newFromUserIdentity()

MediaWiki\User\UserFactory::newFromUserIdentity ( UserIdentity $userIdentity)
See also
User::newFromIdentity
Parameters
UserIdentity$userIdentity
Returns
User

Definition at line 109 of file UserFactory.php.

Member Data Documentation

◆ $userNameUtils

UserNameUtils MediaWiki\User\UserFactory::$userNameUtils
private

Definition at line 41 of file UserFactory.php.

Referenced by MediaWiki\User\UserFactory\__construct().


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