pdo->prepare($query); $statement->execute($queryParams); return $statement->fetchAll(PDO::FETCH_ASSOC); } public function fetchAccountById(int $accountId): array { $statement = $this->pdo->prepare('SELECT * FROM mail_users WHERE user_id = :user_id LIMIT 1'); $statement->execute(['user_id' => $accountId]); if ($statement->rowCount() < 1) { throw new AccountNotFoundException("Account with user ID '$accountId' was not found."); } return $statement->fetch(PDO::FETCH_ASSOC); } }