Added Order Form

This commit is contained in:
Frank Schubert
2021-07-29 20:08:43 +02:00
parent b908aec353
commit 1ae970564f
13 changed files with 1155 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
<?php
class Order extends mfBaseModel {
private $owner;
private $billingaddress;
private $creator;
private $editor;
public function getProperty($name) {
if($this->$name == null) {
if($name == "owner") {
if($this->id) {
$this->owner = new Address($this->owner_id);
return $this->owner;
} else {
return null;
}
}
if($name == "contact") {
if($this->id) {
$this->contact = new Address($this->contact_id);
return $this->contact;
} else {
return null;
}
}
if($name == "billingaddress") {
if($this->id) {
$this->billingaddress = new Address($this->billingaddress_id);
return $this->billingaddress;
} else {
return null;
}
}
if($name == "creator") {
if($this->id) {
$this->creator = new User($this->create_by);
return $this->creator;
} else {
return null;
}
}
if($name == "editor") {
if($this->id) {
$this->editor = new User($this->edit_by);
return $this->editor;
} else {
return null;
}
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);
if($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}