public function getRefreshToken($clientConfigId, Context $context)
{
$stmt = $this->db->prepare("SELECT * FROM refresh_tokens WHERE client_config_id = :client_config_id AND user_id = :user_id AND scope = :scope");
$stmt->bindValue(":client_config_id", $clientConfigId, PDO::PARAM_STR);
$stmt->bindValue(":user_id", $context->getUserId(), PDO::PARAM_STR);
$stmt->bindValue(":scope", $context->getScope()->isEmptyScope() ? null : $context->getScope()->getScopeAsString(), PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if (false !== $result) {
$result['scope'] = new Scope($result['scope']);
return new RefreshToken($result);
}
return false;
}