<?php
require_once('inc/base.php');
require_once('inc/debug.php');
class Domain
{
protected $data = [];
public function __construct($init = null)
{
$this->setup();
switch (gettype($init)) {
case 'string':
$this->loadByName($init);
break;
case 'integer':
$this->loadByID($init);
break;
case 'NULL':
break;
}
}
public function __set($key, $value)
{
if (array_key_exists($key, $this->data)) {
$this->data[$key] = $value;
} elseif (isset($this->$key)) {
$this->$key = $value;
} else {
$this->data[$key] = $value;
}
}
public function __get($key)
{
if (array_key_exists($key, $this->data)) {
return $this->data[$key];