66 lines
1.3 KiB
PHP
66 lines
1.3 KiB
PHP
<?php
|
|
namespace ProVM\Implement;
|
|
|
|
use ProVM\Concept;
|
|
|
|
abstract class Database implements Concept\Database
|
|
{
|
|
protected string $host;
|
|
protected int $port;
|
|
protected string $name;
|
|
protected string $user;
|
|
protected string $password;
|
|
|
|
public function getHost(): string
|
|
{
|
|
return $this->host;
|
|
}
|
|
public function getPort(): int|bool
|
|
{
|
|
return $this->port ?? false;
|
|
}
|
|
public function getName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
public function getUser(): string
|
|
{
|
|
return $this->user;
|
|
}
|
|
public function getPassword(): string
|
|
{
|
|
return $this->password;
|
|
}
|
|
|
|
public function setHost(string $host): Concept\Database
|
|
{
|
|
$this->host = $host;
|
|
return $this;
|
|
}
|
|
public function setPort(int $port): Concept\Database
|
|
{
|
|
$this->port = $port;
|
|
return $this;
|
|
}
|
|
public function setName(string $name): Concept\Database
|
|
{
|
|
$this->name = $name;
|
|
return $this;
|
|
}
|
|
public function setUser(string $username): Concept\Database
|
|
{
|
|
$this->user = $username;
|
|
return $this;
|
|
}
|
|
public function setPassword(string $password): Concept\Database
|
|
{
|
|
$this->password = $password;
|
|
return $this;
|
|
}
|
|
|
|
public function needsUser(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|