<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
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];