MediaWiki
master
|
Public Member Functions | |
__construct (ILoadBalancer $loadBalancer, UserNameUtils $userNameUtils) | |
newAnonymous ( $ip=null) | |
Returns a new anonymous User based on ip. More... | |
newFromActorId (int $actorId) | |
Factory method for creation from a given actor ID, replacing User::newFromActorId. More... | |
newFromAnyId (?int $userId, ?string $userName, ?int $actorId, $dbDomain=false) | |
Factory method for creation from an ID, name, and/or actor ID, replacing User::newFromAnyId. More... | |
newFromAuthority (Authority $authority) | |
newFromConfirmationCode (string $confirmationCode, int $flags=self::READ_NORMAL) | |
Factory method to fetch the user for a given email confirmation code, replacing User::newFromConfirmationCode. More... | |
newFromId (int $id) | |
Factory method for creation from a given user ID, replacing User::newFromId. More... | |
newFromName (string $name, string $validate=self::RIGOR_VALID) | |
Factory method for creating users by name, replacing static User::newFromName. More... | |
newFromRow ( $row, $data=null) | |
newFromUserIdentity (UserIdentity $userIdentity) | |
Factory method for creation fom a given UserIdentity, replacing User::newFromIdentity. More... | |
Private Attributes | |
ILoadBalancer | $loadBalancer |
RIGOR_* constants are inherited from UserRigorOptions READ_* constants are inherited from IDBAccessObject. More... | |
UserNameUtils | $userNameUtils |
Additional Inherited Members | |
![]() | |
const | READ_NONE = -1 |
Constants for object loading bitfield flags (higher => higher QoS) More... | |
Creates User objects.
For now, there is nothing much interesting in this class. It was meant for preventing static User methods causing problems in unit tests.
Definition at line 41 of file UserFactory.php.
MediaWiki\User\UserFactory::__construct | ( | ILoadBalancer | $loadBalancer, |
UserNameUtils | $userNameUtils | ||
) |
ILoadBalancer | $loadBalancer | |
UserNameUtils | $userNameUtils |
Definition at line 58 of file UserFactory.php.
References MediaWiki\User\UserFactory\$loadBalancer, and MediaWiki\User\UserFactory\$userNameUtils.
MediaWiki\User\UserFactory::newAnonymous | ( | $ip = null | ) |
Returns a new anonymous User based on ip.
string | null | $ip | IP address |
Definition at line 109 of file UserFactory.php.
References User\isIP(), and MediaWiki\User\UserFactory\newFromName().
MediaWiki\User\UserFactory::newFromActorId | ( | int | $actorId | ) |
Factory method for creation from a given actor ID, replacing User::newFromActorId.
int | $actorId |
Definition at line 147 of file UserFactory.php.
MediaWiki\User\UserFactory::newFromAnyId | ( | ?int | $userId, |
?string | $userName, | ||
?int | $actorId, | ||
$dbDomain = false |
|||
) |
Factory method for creation from an ID, name, and/or actor ID, replacing User::newFromAnyId.
?int | $userId | |
?string | $userName | |
?int | $actorId | |
bool | string | $dbDomain |
InvalidArgumentException | if none of userId, userName, and actorId are specified |
Definition at line 190 of file UserFactory.php.
References User\setItemLoaded().
Referenced by MediaWiki\User\UserFactory\newFromUserIdentity().
MediaWiki\User\UserFactory::newFromAuthority | ( | Authority | $authority | ) |
Definition at line 294 of file UserFactory.php.
References MediaWiki\Permissions\Authority\getPerformer(), and MediaWiki\User\UserFactory\newFromUserIdentity().
MediaWiki\User\UserFactory::newFromConfirmationCode | ( | string | $confirmationCode, |
int | $flags = self::READ_NORMAL |
||
) |
Factory method to fetch the user for a given email confirmation code, replacing User::newFromConfirmationCode.
This code is generated when an account is created or its e-mail address has changed. If the code is invalid or has expired, returns null.
string | $confirmationCode | |
int | $flags |
Definition at line 250 of file UserFactory.php.
References DBAccessObjectUtils\getDBOptions(), and MediaWiki\User\UserFactory\newFromId().
MediaWiki\User\UserFactory::newFromId | ( | int | $id | ) |
Factory method for creation from a given user ID, replacing User::newFromId.
int | $id | Valid user ID |
Definition at line 131 of file UserFactory.php.
Referenced by MediaWiki\User\UserFactory\newFromConfirmationCode().
MediaWiki\User\UserFactory::newFromName | ( | string | $name, |
string | $validate = self::RIGOR_VALID |
||
) |
Factory method for creating users by name, replacing static User::newFromName.
This is slightly less efficient than newFromId(), so use newFromId() if you have both an ID and a name handy.
string | $name | Username, validated by Title::newFromText |
string | $validate | Validation strategy, one of the RIGOR_* constants. For no validation, use RIGOR_NONE. |
Definition at line 84 of file UserFactory.php.
Referenced by MediaWiki\User\UserFactory\newAnonymous().
MediaWiki\User\UserFactory::newFromRow | ( | $row, | |
$data = null |
|||
) |
stdClass | $row | A row from the user table |
array | null | $data | Further data to load into the object |
Definition at line 285 of file UserFactory.php.
References User\newFromRow().
MediaWiki\User\UserFactory::newFromUserIdentity | ( | UserIdentity | $userIdentity | ) |
Factory method for creation fom a given UserIdentity, replacing User::newFromIdentity.
UserIdentity | $userIdentity |
Definition at line 163 of file UserFactory.php.
References MediaWiki\User\UserIdentity\getActorId(), MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), and MediaWiki\User\UserFactory\newFromAnyId().
Referenced by MediaWiki\User\UserFactory\newFromAuthority().
|
private |
RIGOR_* constants are inherited from UserRigorOptions READ_* constants are inherited from IDBAccessObject.
Definition at line 49 of file UserFactory.php.
Referenced by MediaWiki\User\UserFactory\__construct().
|
private |
Definition at line 52 of file UserFactory.php.
Referenced by MediaWiki\User\UserFactory\__construct().