MediaWiki
REL1_40
ActorNormalization.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\User
;
22
23
use
CannotCreateActorException
;
24
use InvalidArgumentException;
25
use stdClass;
26
use
Wikimedia\Rdbms\IDatabase
;
27
use
Wikimedia\Rdbms\IReadableDatabase
;
28
33
interface
ActorNormalization
{
34
49
public
function
newActorFromRow
( stdClass $row ):
UserIdentity
;
50
67
public
function
newActorFromRowFields
( $userId, $name, $actorId ):
UserIdentity
;
68
77
public
function
findActorIdByName
(
string
$name,
IDatabase
$db ): ?int;
78
87
public
function
findActorId
(
UserIdentity
$user,
IReadableDatabase
$db ): ?int;
88
99
public
function
acquireActorId
(
UserIdentity
$user,
IDatabase
$dbw ): int;
100
109
public
function
getActorById
(
int
$actorId,
IDatabase
$db ): ?
UserIdentity
;
110
117
public
function
getUnknownActor
():
UserIdentity
;
118
}
CannotCreateActorException
Exception thrown when an actor can't be created.
Definition
CannotCreateActorException.php:29
MediaWiki\User\ActorNormalization
Service for dealing with the actor table.
Definition
ActorNormalization.php:33
MediaWiki\User\ActorNormalization\findActorIdByName
findActorIdByName(string $name, IDatabase $db)
Find the actor_id for the given name.
MediaWiki\User\ActorNormalization\newActorFromRowFields
newActorFromRowFields( $userId, $name, $actorId)
Instantiate a new UserIdentity object based on field values from a DB row.
MediaWiki\User\ActorNormalization\getUnknownActor
getUnknownActor()
In case all reasonable attempts of initializing a proper actor from the database have failed,...
MediaWiki\User\ActorNormalization\acquireActorId
acquireActorId(UserIdentity $user, IDatabase $dbw)
Attempt to assign an actor ID to the given $user If it is already assigned, return the existing ID.
MediaWiki\User\ActorNormalization\newActorFromRow
newActorFromRow(stdClass $row)
Instantiate a new UserIdentity object based on a $row from the actor table.
MediaWiki\User\ActorNormalization\findActorId
findActorId(UserIdentity $user, IReadableDatabase $db)
Find the actor_id of the given $user.
MediaWiki\User\ActorNormalization\getActorById
getActorById(int $actorId, IDatabase $db)
Find an actor by $id.
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:39
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition
IDatabase.php:36
Wikimedia\Rdbms\IReadableDatabase
A database connection without write operations.
Definition
IReadableDatabase.php:33
MediaWiki\User
Definition
ActorCache.php:21
includes
user
ActorNormalization.php
Generated on Thu Jun 27 2024 14:04:29 for MediaWiki by
1.10.0