This commit is contained in:
2020-04-02 21:39:02 +02:00
parent 15762350d2
commit 2611aa2c1b
2 changed files with 25 additions and 13 deletions

View File

@@ -7,13 +7,13 @@ abstract class Document {
protected $head;
protected $body;
protected $user;
protected $databseRequired;
protected $databaseRequired;
public function __construct($user, $headClass, $bodyClass) {
$this->head = new $headClass($this);
$this->body = new $bodyClass($this);
$this->user = $user;
$this->databseRequired = true;
$this->databaseRequired = true;
}
public function getHead() { return $this->head; }
@@ -55,7 +55,7 @@ abstract class Document {
function getCode() {
if ($this->databseRequired) {
if ($this->databaseRequired) {
$sql = $this->user->getSQL();
if (is_null($sql)) {
die("Database is not configured yet.");