Neuron-PHP

DatabaseEmailVerificationTokenRepository
in package
implements IEmailVerificationTokenRepository

Database-backed email verification token repository.

Works with SQLite, MySQL, and PostgreSQL via PDO.

Table of Contents

Interfaces

IEmailVerificationTokenRepository
Email verification token repository interface.

Properties

$_pdo  : PDO

Methods

__construct()  : mixed
Constructor
__sleep()  : array<string|int, mixed>
Handle serialization for PHPUnit process isolation
__wakeup()  : void
Handle unserialization for PHPUnit process isolation
create()  : EmailVerificationToken
Create a new email verification token
deleteByToken()  : bool
Delete a specific token by its hashed value
deleteByUserId()  : int
Delete all tokens for a given user ID
deleteExpired()  : int
Delete all expired tokens
findByToken()  : EmailVerificationToken|null
Find a token by its hashed value
findByUserId()  : EmailVerificationToken|null
Find most recent token by user ID
mapRowToToken()  : EmailVerificationToken
Map database row to EmailVerificationToken object

Properties

Methods

deleteByToken()

Delete a specific token by its hashed value

public deleteByToken(string $token) : bool
Parameters
$token : string

Hashed token

Return values
bool

True if deleted, false otherwise

deleteByUserId()

Delete all tokens for a given user ID

public deleteByUserId(int $userId) : int
Parameters
$userId : int

User ID

Return values
int

Number of tokens deleted


        
On this page

Search results