Files
rvr-nextgen/src/Repository/OAuthClientRepository.php
T
bence dccb34971b
rvr-nextgen/pipeline/pr-master This commit looks good
adapt Container usage to new soko-web
2023-04-19 23:38:43 +02:00

21 lines
584 B
PHP

<?php namespace RVR\Repository;
use SokoWeb\Database\Query\Select;
use RVR\PersistentData\Model\OAuthClient;
class OAuthClientRepository
{
public function getById(int $id): ?OAuthClient
{
return \Container::$persistentDataManager->selectFromDbById($id, OAuthClient::class);
}
public function getByClientId(string $clientId): ?OAuthClient
{
$select = new Select(\Container::$dbConnection);
$select->where('client_id', '=', $clientId);
return \Container::$persistentDataManager->selectFromDb($select, OAuthClient::class);
}
}