adapt Container usage to new soko-web
rvr-nextgen/pipeline/pr-master This commit looks good

This commit is contained in:
bence committed 2023-04-19 23:38:43 +02:00
1 parent 36f767ea9b
commit dccb34971b
20 files changed
+135 -237

No files matched your search

+2 -10
View File
@@ -2,20 +2,12 @@
use SokoWeb\Database\Query\Select;
use RVR\PersistentData\Model\OAuthClient;
use SokoWeb\PersistentData\PersistentDataManager;
class OAuthClientRepository
{
private PersistentDataManager $pdm;
public function __construct()
{
$this->pdm = new PersistentDataManager();
}
public function getById(int $id): ?OAuthClient
{
return $this->pdm->selectFromDbById($id, OAuthClient::class);
return \Container::$persistentDataManager->selectFromDbById($id, OAuthClient::class);
}
public function getByClientId(string $clientId): ?OAuthClient
@@ -23,6 +15,6 @@ class OAuthClientRepository
$select = new Select(\Container::$dbConnection);
$select->where('client_id', '=', $clientId);
return $this->pdm->selectFromDb($select, OAuthClient::class);
return \Container::$persistentDataManager->selectFromDb($select, OAuthClient::class);
}
}