MediaWiki master
ActorNormalization.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\User;
8
9use InvalidArgumentException;
11use stdClass;
14
20
35 public function newActorFromRow( stdClass $row ): UserIdentity;
36
53 public function newActorFromRowFields( $userId, $name, $actorId ): UserIdentity;
54
63 public function findActorIdByName( string $name, IReadableDatabase $db ): ?int;
64
73 public function findActorId( UserIdentity $user, IReadableDatabase $db ): ?int;
74
85 public function acquireActorId( UserIdentity $user, IDatabase $dbw ): int;
86
95 public function getActorById( int $actorId, IReadableDatabase $db ): ?UserIdentity;
96
103 public function getUnknownActor(): UserIdentity;
104}
Exception thrown when an actor can't be created.
Service for dealing with the actor table.
getActorById(int $actorId, IReadableDatabase $db)
Find an actor by $id.
findActorIdByName(string $name, IReadableDatabase $db)
Find the actor_id for the given name.
newActorFromRowFields( $userId, $name, $actorId)
Instantiate a new UserIdentity object based on field values from a DB row.
getUnknownActor()
In case all reasonable attempts of initializing a proper actor from the database have failed,...
acquireActorId(UserIdentity $user, IDatabase $dbw)
Attempt to assign an actor ID to the given $user If it is already assigned, return the existing ID.
newActorFromRow(stdClass $row)
Instantiate a new UserIdentity object based on a $row from the actor table.
findActorId(UserIdentity $user, IReadableDatabase $db)
Find the actor_id of the given $user.
Interface for objects representing user identity.
Interface to a relational database.
Definition IDatabase.php:31
A database connection without write operations.