Overhauled Address linking

This commit is contained in:
Frank Schubert
2022-06-29 17:16:14 +02:00
parent bbfc6c6eb5
commit 2d09924372
12 changed files with 637 additions and 74 deletions

View File

@@ -3,6 +3,7 @@
class Order extends mfBaseModel {
private $owner;
private $billingaddress;
private $techcontact;
private $products;
private $customer_type;
private $contracts;
@@ -251,6 +252,17 @@ class Order extends mfBaseModel {
return $this->billingaddress;
}
if($name == "techcontact") {
$this->techcontact = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->techcontact_id);
if($this->techcontact === null) {
$this->techcontact = new Address($this->techcontact_id);
if($this->techcontact->id) {
mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->techcontact_id, $this->techcontact);
}
}
return $this->techcontact;
}
if($name == "products") {
$this->products = OrderProductModel::search(["order_id" => $this->id]);
//var_dump($this->products);exit;