Files
rvr-nextgen/src/Repository/OAuthClientRepository.php
T
bence a7790319eb
rvr-nextgen/pipeline/pr-master This commit looks good
restrict oauth access
2023-04-12 00:10:14 +02:00

29 lines
724 B
PHP

<?php namespace RVR\Repository;
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);
}
public function getByClientId(string $clientId): ?OAuthClient
{
$select = new Select(\Container::$dbConnection);
$select->where('client_id', '=', $clientId);
return $this->pdm->selectFromDb($select, OAuthClient::class);
}
}