web-base/core/Objects/ConnectionData.class.php

42 lines
952 B
PHP
Raw Normal View History

2020-02-09 23:02:19 +01:00
<?php
namespace Objects;
class ConnectionData {
2020-04-03 15:56:04 +02:00
private string $host;
private int $port;
private string $login;
private string $password;
private array $properties;
2020-02-09 23:02:19 +01:00
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() {
return $this->properties;
}
2020-04-02 01:48:46 +02:00
public function getProperty($key, $defaultValue='') {
return $this->properties[$key] ?? $defaultValue;
2020-02-09 23:02:19 +01:00
}
public function setProperty($key, $val) {
if(!is_string($val)) {
return false;
}
$this->properties[$key] = $val;
2020-04-03 15:56:04 +02:00
return true;
2020-02-09 23:02:19 +01:00
}
public function getHost() { return $this->host; }
public function getPort() { return $this->port; }
public function getLogin() { return $this->login; }
public function getPassword() { return $this->password; }
2020-04-03 15:56:04 +02:00
}