ConstructionConsentProject: Added company permissions
This commit is contained in:
@@ -4,6 +4,7 @@ class ConstructionConsentProject extends mfBaseModel {
|
||||
private $consents;
|
||||
private $networks;
|
||||
private $adb_networks;
|
||||
private $addresses;
|
||||
|
||||
protected function beforeUpdate($data) {
|
||||
if(!array_key_exists("edit_by", $data)) {
|
||||
@@ -18,11 +19,21 @@ class ConstructionConsentProject extends mfBaseModel {
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "addresses") {
|
||||
$addresses = ConstructionConsentProjectAddress::search(["constructionconsentproject_id" => $this->id]);
|
||||
if(!count($addresses)) {
|
||||
return [];
|
||||
}
|
||||
foreach($addresses as $address) {
|
||||
$this->addresses[$address->address->id] = $address;
|
||||
}
|
||||
return $this->addresses;
|
||||
}
|
||||
|
||||
if($name == "consents") {
|
||||
$consents = ConstructionConsent::search(["constructionconsentproject_id" => $this->id]);
|
||||
if(!$consents) {
|
||||
return [];
|
||||
|
||||
}
|
||||
$this->consents = $consents;
|
||||
return $this->consents;
|
||||
|
||||
Reference in New Issue
Block a user