Moved Building unit count to Building Model

This commit is contained in:
Frank Schubert
2024-01-05 17:45:50 +01:00
parent 7646345779
commit 3591da6729
3 changed files with 34 additions and 5 deletions
+11 -1
View File
@@ -3,6 +3,7 @@
class Termination extends mfBaseModel {
protected $forcestr = ['phone','email','note'];
private $in_after_save = 0;
private $building;
private $status;
private $lineworker;
@@ -14,7 +15,16 @@ class Termination extends mfBaseModel {
private $creator;
private $editor;
protected function afterSave() {
if($this->in_after_save) return true;
$this->in_after_save++;
if($this->building_id) {
$this->getProperty("building")->updateUnitCount();
}
$this->in_after_save--;
}
public function getAddress($singelLine = false) {
if(!$this->id) {