21 lines
584 B
PHP
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);
|
|
}
|
|
}
|