Phred/src/Orm/PairityConnection.php

33 lines
626 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace Phred\Orm;
use Phred\Orm\Contracts\ConnectionInterface;
2025-12-21 23:01:10 +00:00
use Pairity\Manager;
final class PairityConnection implements ConnectionInterface
{
private bool $connected = false;
2025-12-21 23:01:10 +00:00
private ?Manager $manager = null;
public function connect(): void
{
$this->connected = true;
2025-12-21 23:01:10 +00:00
$this->manager = new Manager();
}
public function isConnected(): bool
{
return $this->connected;
}
2025-12-21 23:01:10 +00:00
public function getManager(): Manager
{
if (!$this->manager) {
$this->connect();
}
return $this->manager;
}
}