<?php
namespace App\Service;

use App\Alias\RemoteConnection;
use PDO;

class Remote
{
    public function __construct(protected RemoteConnection $connection) {}

    public function getIP(): string
    {
        $query = "SELECT `ip` FROM `remote_ip` WHERE `host` = 'vialdelamaza'";
        $connection = $this->connection->connect();
        $statement = $connection->query($query);
        $result = $statement->fetch(PDO::FETCH_ASSOC);
        return $result['ip'];
    }
}
