Files
thetool/application/Voiceplanzone/Voiceplanzone.php
2023-10-13 11:31:45 +02:00

33 lines
688 B
PHP

<?php
class Voiceplanzone extends mfBaseModel {
private $destinations;
private $voiceplan;
public function getProperty($name) {
if($this->$name == null) {
if(!$this->id) {
return null;
}
if($name == "destinations") {
$this->destinations = VoiceplandestinationModel::search(["voiceplanzone_id" => $this->id]);
return $this->destinations;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);
if($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}