From 8987b563dd2f8bfa3cb63a5925bf1061adf62ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 25 Jun 2020 20:25:34 +0200 Subject: [PATCH] MAPG-156 add getByUser to UserConfirmationRepository --- src/Repository/UserConfirmationRepository.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Repository/UserConfirmationRepository.php b/src/Repository/UserConfirmationRepository.php index 62df3ae..5c0723e 100644 --- a/src/Repository/UserConfirmationRepository.php +++ b/src/Repository/UserConfirmationRepository.php @@ -1,6 +1,9 @@ pdm->selectFromDb($select, UserConfirmation::class); } + + public function getByUser(User $user): Generator + { + $select = new Select(\Container::$dbConnection); + $select->where('user_id', '=', $user->getId()); + + yield from $this->pdm->selectMultipleFromDb($select, UserConfirmation::class); + } }