Skip to content

PdoUserProvider

Resolves identities from a single users table via the framework’s DatabaseManager, matching the security.xml <provider type="pdo" connection="main" table="users" identifier-column="email" password-column="password_hash"> shape.

Role/permission assignment is left to RbacSecurityUser’s own definitions, not this table.

final class PdoUserProvider implements UserProviderInterface

ImplementsUserProviderInterface
Since1.0.0
SourceProvider/PdoUserProvider.php

public function __construct(DatabaseManager $databaseManager, string $connection = 'main', string $table = 'users', string $identifierColumn = 'email', string $passwordColumn = 'password_hash'): mixed

The column holding the password hash.

ParameterTypeDescription
$databaseManagerDatabaseManagerThe framework’s database manager.
$connectionstringThe databases.xml connection name to use.
$tablestringThe users table name.
$identifierColumnstringThe column holding the stable identifier (e.g. email/username).
$passwordColumnstringThe column holding the password hash.

Returns mixed

ThrowsWhen
InvalidArgumentExceptionIf $table/$identifierColumn/$passwordColumn is not a valid SQL identifier.
MethodDescription
loadByIdentifier(string $identifier): ?UserIdentity
loadByToken(TokenClaims $claims): nullClaim -> row mapping (e.g.

public function loadByIdentifier(string $identifier): ?UserIdentity

E.g. an email or username.

ParameterTypeDescription
$identifierstringE.g. an email or username.

Returns ?UserIdentity — Null if no matching row exists.

ThrowsWhen
RuntimeExceptionIf the configured connection is not PDO-backed.

public function loadByToken(TokenClaims $claims): null

Claim -> row mapping (e.g.

The validated token claims.

ParameterTypeDescription
$claimsTokenClaimsThe validated token claims.

Returns null — Always null in the base implementation.