Added termination select to Product/Form

This commit is contained in:
Frank Schubert
2021-07-30 20:03:24 +02:00
parent ec0abff225
commit 0a5e447587
11 changed files with 249 additions and 28 deletions

View File

@@ -1,7 +1,8 @@
<?php
class File extends mfBaseModel {
private $creator;
private $editor;
public function delete() {
if($this->id) {
@@ -28,4 +29,36 @@ class File extends mfBaseModel {
}
return false;
}
public function getProperty($name) {
if($this->$name == null) {
if(!$this->id) {
return null;
}
if($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;
}
if($name == "editor") {
$this->editor = new User($this->edit_by);
return $this->editor;
}
$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;
}
}