Namespace and ClassPath rewrites
This commit is contained in:
42
Core/Objects/ConnectionData.class.php
Normal file
42
Core/Objects/ConnectionData.class.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Objects;
|
||||
|
||||
class ConnectionData {
|
||||
|
||||
private string $host;
|
||||
private int $port;
|
||||
private string $login;
|
||||
private string $password;
|
||||
private array $properties;
|
||||
|
||||
public function __construct($host, $port, $login, $password) {
|
||||
$this->host = $host;
|
||||
$this->port = $port;
|
||||
$this->login = $login;
|
||||
$this->password = $password;
|
||||
$this->properties = array();
|
||||
}
|
||||
|
||||
public function getProperties(): array {
|
||||
return $this->properties;
|
||||
}
|
||||
|
||||
public function getProperty($key, $defaultValue='') {
|
||||
return $this->properties[$key] ?? $defaultValue;
|
||||
}
|
||||
|
||||
public function setProperty($key, $val): bool {
|
||||
if (!is_scalar($val)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->properties[$key] = $val;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getHost(): string { return $this->host; }
|
||||
public function getPort(): int { return $this->port; }
|
||||
public function getLogin(): string { return $this->login; }
|
||||
public function getPassword(): string { return $this->password; }
|
||||
}
|
||||
Reference in New Issue
Block a user