Contract WIP
This commit is contained in:
@@ -10,6 +10,7 @@ class Address extends mfBaseModel {
|
||||
private $attributes;
|
||||
private $permissions;
|
||||
private $contracts;
|
||||
private $active_contracts;
|
||||
|
||||
private $phoneparts;
|
||||
|
||||
@@ -190,6 +191,13 @@ class Address extends mfBaseModel {
|
||||
return $this->contracts;
|
||||
}
|
||||
|
||||
if($name == "active_contracts") {
|
||||
$owning = ContractModel::searchActive(['owner_id' => $this->id]);
|
||||
$billing = ContractModel::searchActive(['billingaddress_id' => $this->id]);
|
||||
$this->contracts = array_merge($owning, $billing);
|
||||
return $this->contracts;
|
||||
}
|
||||
|
||||
/*
|
||||
if($name == "links_to") {
|
||||
$links = AddressLinkModel::search(['address_id' => $this->id]);
|
||||
|
||||
Reference in New Issue
Block a user