Added adding POPs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user