Moved Building unit count to Building Model
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user