Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8d6e911a6 | ||
|
|
03d26d9167 |
@@ -40,7 +40,7 @@ class Connection
|
|||||||
$key = (strtolower(trim($this->name)));
|
$key = (strtolower(trim($this->name)));
|
||||||
$this->type = isset($config[$key]["TYPE"]) ? $config[$key]["TYPE"] : null;
|
$this->type = isset($config[$key]["TYPE"]) ? $config[$key]["TYPE"] : null;
|
||||||
$this->user = isset($config[$key]["USER"]) ? $config[$key]["USER"] : null;
|
$this->user = isset($config[$key]["USER"]) ? $config[$key]["USER"] : null;
|
||||||
$this->host = isset($config[$key]["HOST"]) ? $config[$config[$key]["HOST"]] : null;
|
$this->host = isset($config[$key]["HOST"]) ? $config[$key]["HOST"] : null;
|
||||||
$this->password = isset($config[$key]["PASSWORD"]) ? $config[$key]["PASSWORD"] : null;
|
$this->password = isset($config[$key]["PASSWORD"]) ? $config[$key]["PASSWORD"] : null;
|
||||||
$this->database = isset($config[$key]["DATABASE"]) ? $config[$key]["DATABASE"] : null;
|
$this->database = isset($config[$key]["DATABASE"]) ? $config[$key]["DATABASE"] : null;
|
||||||
$this->port = isset($config[$key]["PORT"]) ? $config[$key]["PORT"] : null;
|
$this->port = isset($config[$key]["PORT"]) ? $config[$key]["PORT"] : null;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Model implements JsonSerializable
|
|||||||
{
|
{
|
||||||
protected mixed $values;
|
protected mixed $values;
|
||||||
protected array $updated;
|
protected array $updated;
|
||||||
protected string $table;
|
protected string $table = "";
|
||||||
protected string $connection = "";
|
protected string $connection = "";
|
||||||
protected string $pk;
|
protected string $pk;
|
||||||
private bool $new;
|
private bool $new;
|
||||||
@@ -19,7 +19,14 @@ class Model implements JsonSerializable
|
|||||||
$this->values = array();
|
$this->values = array();
|
||||||
$this->updated = array();
|
$this->updated = array();
|
||||||
$this->pk = "id";
|
$this->pk = "id";
|
||||||
$this->table = $this->getDefaultTableName();
|
$this->initTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initTable(): void
|
||||||
|
{
|
||||||
|
if ($this->table == "") {
|
||||||
|
$this->table = $this->getDefaultTableName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTable(): string
|
public function getTable(): string
|
||||||
|
|||||||
Reference in New Issue
Block a user