<?php

namespace Slovocast\Infrastructure;

use PDO;
use Slovocast\Infrastructure\DatabaseConnectionInterface;

/**
 * Represents an active connection to a database
 */
class DatabaseConnection implements DatabaseConnectionInterface
{
    private string $name;
    private PDO $pdo;

    public function __construct(string $name, PDO $pdo)
    {
        $this->name = $name;
        $this->pdo = $pdo;
    }

    public function getConnection(): PDO
    {
        return $this->pdo;
    }

    public function getName(): string
    {
        return $this->name;
    }
}
