MediaWiki REL1_39
|
Service for dealing with the actor table. More...
Public Member Functions | |
acquireActorId (UserIdentity $user, IDatabase $dbw) | |
Attempt to assign an actor ID to the given $user If it is already assigned, return the existing ID. | |
findActorId (UserIdentity $user, IDatabase $db) | |
Find the actor_id of the given $user. | |
findActorIdByName (string $name, IDatabase $db) | |
Find the actor_id for the given name. | |
getActorById (int $actorId, IDatabase $db) | |
Find an actor by $id. | |
getUnknownActor () | |
In case all reasonable attempts of initializing a proper actor from the database have failed, entities can be attributed to special 'Unknown user' actor. | |
newActorFromRow (stdClass $row) | |
Instantiate a new UserIdentity object based on a $row from the actor table. | |
newActorFromRowFields ( $userId, $name, $actorId) | |
Instantiate a new UserIdentity object based on field values from a DB row. | |
Service for dealing with the actor table.
Definition at line 32 of file ActorNormalization.php.
MediaWiki\User\ActorNormalization::acquireActorId | ( | UserIdentity | $user, |
IDatabase | $dbw ) |
Attempt to assign an actor ID to the given $user If it is already assigned, return the existing ID.
UserIdentity | $user | |
IDatabase | $dbw | The database connection to acquire the ID from. The database must correspond to the wiki this ActorNormalization is bound to. |
CannotCreateActorException | if no actor ID has been assigned to this $user |
Implemented in MediaWiki\User\ActorStore.
MediaWiki\User\ActorNormalization::findActorId | ( | UserIdentity | $user, |
IDatabase | $db ) |
Find the actor_id of the given $user.
UserIdentity | $user | |
IDatabase | $db | The database connection to operate on. The database must correspond to the wiki this ActorNormalization is bound to. |
Implemented in MediaWiki\User\ActorStore.
MediaWiki\User\ActorNormalization::findActorIdByName | ( | string | $name, |
IDatabase | $db ) |
Find the actor_id for the given name.
string | $name | |
IDatabase | $db | The database connection to operate on. The database must correspond to the wiki this ActorNormalization is bound to. |
MediaWiki\User\ActorNormalization::getActorById | ( | int | $actorId, |
IDatabase | $db ) |
Find an actor by $id.
int | $actorId | |
IDatabase | $db | The database connection to operate on. The database must correspond to the wiki this ActorNormalization is bound to. |
Implemented in MediaWiki\User\ActorStore.
MediaWiki\User\ActorNormalization::getUnknownActor | ( | ) |
In case all reasonable attempts of initializing a proper actor from the database have failed, entities can be attributed to special 'Unknown user' actor.
Implemented in MediaWiki\User\ActorStore.
MediaWiki\User\ActorNormalization::newActorFromRow | ( | stdClass | $row | ) |
Instantiate a new UserIdentity object based on a $row from the actor table.
Use this method when an actor row was already fetched from the DB via a join. This method just constructs a new instance and does not try fetching missing values from the DB again, use UserIdentityLookup
for that.
stdClass | $row | with the following fields:
|
InvalidArgumentException |
Implemented in MediaWiki\User\ActorStore.
MediaWiki\User\ActorNormalization::newActorFromRowFields | ( | $userId, | |
$name, | |||
$actorId ) |
Instantiate a new UserIdentity object based on field values from a DB row.
Until ActorMigration
is completed, the actor table joins alias actor field names to legacy field names. This method is convenience to construct the UserIdentity based on legacy field names. It's more relaxed with typing then ::newFromRow to better support legacy code, so always prefer ::newFromRow in new code. Eventually, once ActorMigration
is completed and all queries use explicit join with actor table, this method will be deprecated and removed.
InvalidArgumentException |
int | null | $userId | |
string | null | $name | |
int | null | $actorId |
Implemented in MediaWiki\User\ActorStore.