adapt Container usage to new soko-web
This commit is contained in:
23 files changed
+248
-397
No files matched your search
@@ -3,20 +3,12 @@
|
||||
use SokoWeb\Database\Query\Select;
|
||||
use MapGuesser\PersistentData\Model\User;
|
||||
use MapGuesser\PersistentData\Model\UserConfirmation;
|
||||
use SokoWeb\PersistentData\PersistentDataManager;
|
||||
|
||||
class UserConfirmationRepository
|
||||
{
|
||||
private PersistentDataManager $pdm;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pdm = new PersistentDataManager();
|
||||
}
|
||||
|
||||
public function getById(int $userConfirmationId): ?UserConfirmation
|
||||
{
|
||||
return $this->pdm->selectFromDbById($userConfirmationId, UserConfirmation::class);
|
||||
return \Container::$persistentDataManager->selectFromDbById($userConfirmationId, UserConfirmation::class);
|
||||
}
|
||||
|
||||
public function getByToken(string $token): ?UserConfirmation
|
||||
@@ -24,7 +16,7 @@ class UserConfirmationRepository
|
||||
$select = new Select(\Container::$dbConnection);
|
||||
$select->where('token', '=', $token);
|
||||
|
||||
return $this->pdm->selectFromDb($select, UserConfirmation::class);
|
||||
return \Container::$persistentDataManager->selectFromDb($select, UserConfirmation::class);
|
||||
}
|
||||
|
||||
public function getByUser(User $user): ?UserConfirmation
|
||||
@@ -32,6 +24,6 @@ class UserConfirmationRepository
|
||||
$select = new Select(\Container::$dbConnection);
|
||||
$select->where('user_id', '=', $user->getId());
|
||||
|
||||
return $this->pdm->selectFromDb($select, UserConfirmation::class);
|
||||
return \Container::$persistentDataManager->selectFromDb($select, UserConfirmation::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user