Added adb unit count to OpenAccessId Index

This commit is contained in:
Frank Schubert
2024-01-22 11:24:14 +01:00
parent 3ab04b7a20
commit 5d051406fa
3 changed files with 26 additions and 8 deletions
@@ -3,6 +3,7 @@
class OpenAccessId extends mfBaseModel {
private $owner;
private $adb_wohneinheit;
private $adb_wohneinheit_count;
private $termination;
public function loadRandomUnassigned($attributes = []) {
@@ -332,6 +333,11 @@ class OpenAccessId extends mfBaseModel {
return $this->adb_wohneinheit;
}
if($name == "adb_wohneinheit_count") {
$this->adb_wohneinheit_count = ADBWohneinheitModel::count(["oaid" => $this->oaid]);
return $this->adb_wohneinheit_count;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);