Now listing creator and editor in Building/Index

This commit is contained in:
Frank Schubert
2025-02-07 14:08:37 +01:00
parent 234dd0c27f
commit fd9367bd8d
2 changed files with 30 additions and 1 deletions

View File

@@ -15,7 +15,9 @@ class Building extends mfBaseModel {
private $workflowitems;
private $files;
private $pipework_enabler;
private $creator;
private $editor;
public function getAddress($singelLine = false) {
if(!$this->id) {
return false;
@@ -327,6 +329,28 @@ class Building extends mfBaseModel {
return $this->pipework_enabler;
}
if($name == "creator") {
$this->creator = mfValuecache::singleton()->get("Worker-id-" . $this->create_by);
if($this->creator === null) {
$this->creator = new User($this->create_by);
if($this->creator->id) {
mfValuecache::singleton()->set("Worker-id-" . $this->create_by, $this->creator);
}
}
return $this->creator;
}
if($name == "editor") {
$this->editor = mfValuecache::singleton()->get("Worker-id-" . $this->edit_by);
if($this->editor === null) {
$this->editor = new User($this->edit_by);
if($this->editor->id) {
mfValuecache::singleton()->set("Worker-id-" . $this->edit_by, $this->editor);
}
}
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);