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

40 lines
868 B
PHP

<?php
class Voiceplandestination extends mfBaseModel {
protected $forcestr = ["name", "destination", "prefix"];
private $voiceplan;
public function getProperty($name) {
if($this->$name == null) {
if(!$this->id) {
return null;
}
if($name == "voiceplan") {
$zone = $this->getProperty("voiceplanzone");
if($zone->voiceplan_id) {
$voiceplan = new Voiceplan($zone->voiceplan_id);
if($voiceplan->id) {
$this->voiceplan = $voiceplan;
}
}
return $this->voiceplan;
}
$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;
}
}