Added adding POPs

This commit is contained in:
Frank Schubert
2021-06-29 20:57:24 +02:00
parent 032390a097
commit 8f4e179315
8 changed files with 283 additions and 27 deletions

View File

@@ -2,6 +2,7 @@
class Network extends mfBaseModel {
private $owner;
private $pops;
public function getProperty($name) {
if($this->$name == null) {
@@ -15,6 +16,16 @@ class Network extends mfBaseModel {
}
}
if($name == "pops") {
if($this->id) {
$pops = PopModel::search(['network_id' => $this->id]);
$this->pops = $pops;
return $this->pops;
} else {
return null;
}
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);