Files
thetool/application/Voiceplandestination/Voiceplandestination.php

60 lines
1.2 KiB
PHP

<?php
class Voiceplandestination extends mfBaseModel {
protected $forcestr = ["name", "destination", "prefix"];
private $voiceplan;
private $voiceplanzone;
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;
}
public function __clone() {
$me = new User;
$me->loadMe();
$old_id = $this->id;
$this->id = null;
$this->voiceplan = null;
$this->create_by = $me->id;
$this->edit_by = $me->id;
$this->create = null;
$this->edit = null;
$this->saved = 0;
$this->mode = "new";
$this->_old_data = new StdClass();
}
}