database = $database; } /** * Insert a deleted user by username. * * @throws DatabaseException If the username could not be inserted */ public function insertByUsername(string $username): void { $throw = $this->database->throwExceptionsOnErrors(true); try { $this->database->insert('userd', ['username' => $username]); } finally { $this->database->throwExceptionsOnErrors($throw); } } /** * Check if a deleted username exists. * * @throws \Exception */ public function existsByUsername(string $username): bool { return $this->database->exists('userd', ['username' => $username]); } }