MAPG-156 add getByUser to UserConfirmationRepository
This commit is contained in:
parent
70d8807f38
commit
8987b563dd
@ -1,6 +1,9 @@
|
||||
<?php namespace MapGuesser\Repository;
|
||||
|
||||
use Generator;
|
||||
use MapGuesser\Database\Query\Select;
|
||||
use MapGuesser\Interfaces\Database\IResultSet;
|
||||
use MapGuesser\PersistentData\Model\User;
|
||||
use MapGuesser\PersistentData\Model\UserConfirmation;
|
||||
use MapGuesser\PersistentData\PersistentDataManager;
|
||||
|
||||
@ -25,4 +28,12 @@ class UserConfirmationRepository
|
||||
|
||||
return $this->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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user