MediaWiki  master
ActorNormalization.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\User;
22 
24 use InvalidArgumentException;
25 use stdClass;
27 
32 interface ActorNormalization {
33 
48  public function newActorFromRow( stdClass $row ): UserIdentity;
49 
66  public function newActorFromRowFields( $userId, $name, $actorId ): UserIdentity;
67 
76  public function findActorIdByName( string $name, IDatabase $db ): ?int;
77 
86  public function findActorId( UserIdentity $user, IDatabase $db ): ?int;
87 
98  public function acquireActorId( UserIdentity $user, IDatabase $dbw ): int;
99 
108  public function getActorById( int $actorId, IDatabase $db ): ?UserIdentity;
109 
116  public function getUnknownActor(): UserIdentity;
117 }
Exception thrown when an actor can't be created.
Service for dealing with the actor table.
findActorIdByName(string $name, IDatabase $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, IDatabase $db)
Find the actor_id of the given $user.
getActorById(int $actorId, IDatabase $db)
Find an actor by $id.
Interface for objects representing user identity.
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40