ConstructionConsent Basic Building data
This commit is contained in:
@@ -10,6 +10,7 @@ class ConstructionConsent extends mfBaseModel {
|
||||
private $file;
|
||||
private $creator;
|
||||
private $editor;
|
||||
private $preorder_count;
|
||||
|
||||
private $footer_text = "Energie Steiermark Breitband GmbH, A-8010 Graz, Leonhardgürtel 10, Telefon +43 (0)316 9000-0\nSitz Graz, FN 576705x, Landesgericht für ZRS Graz, ATU 77949678, breitband@e-steiermark.com, www.e-steiermark.com";
|
||||
private $footer_font = "ITC Officina Sans Std";
|
||||
@@ -53,7 +54,7 @@ class ConstructionConsent extends mfBaseModel {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "project") {
|
||||
$project = new ConstructionConsentProject($this->id);
|
||||
$project = new ConstructionConsentProject($this->constructionconsentproject_id);
|
||||
if($project->id) {
|
||||
$this->project = $project;
|
||||
}
|
||||
@@ -78,6 +79,24 @@ class ConstructionConsent extends mfBaseModel {
|
||||
return $this->adb_strasse;
|
||||
}
|
||||
|
||||
if($name == "preorder_count") {
|
||||
if(!$this->adb_hausnummer_id) {
|
||||
return 0;
|
||||
}
|
||||
$preorder_count = 0;
|
||||
foreach(PreorderModel::search(["adb_hausnummer_id" => $this->adb_hausnummer_id]) as $preorder) {
|
||||
if($preorder->connection_count) {
|
||||
$preorder_count += $preorder->connection_count;
|
||||
} else {
|
||||
$preorder_count++;
|
||||
}
|
||||
}
|
||||
if($preorder_count) {
|
||||
$this->preorder_count = $preorder_count;
|
||||
}
|
||||
return $this->preorder_count;
|
||||
}
|
||||
|
||||
if($name == "owners") {
|
||||
if(!$this->id) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user