DbUsernameRecoveryRepository
class DbUsernameRecoveryRepository (View source)
Methods
Create a new username recovery request record
Count recent recovery attempts for a specific email address
Count recent recovery attempts by IP address
Get the timestamp of the last recovery attempt for an email
Delete old recovery request records
Delete all recovery requests for a specific email
Get total count of recovery requests in the system
Details
__construct(PDO $db, ConfigurationManager $config)
No description
bool
create(array $data)
Create a new username recovery request record
int
countRecentAttempts(string $email, int $seconds)
Count recent recovery attempts for a specific email address
int
countRecentAttemptsByIp(string $ip, int $seconds)
Count recent recovery attempts by IP address
string|null
getLastAttemptTime(string $email)
Get the timestamp of the last recovery attempt for an email
int
deleteOlderThan(int $days = 30)
Delete old recovery request records
Cleanup strategy:
- Delete records older than the specified number of days
- Default: 30 days for audit trail purposes
This method can be called periodically for maintenance.
int
deleteByEmail(string $email)
Delete all recovery requests for a specific email
int
getTotalCount()
Get total count of recovery requests in the system