Changed to contractqueue and contract

This commit is contained in:
Frank Schubert
2024-08-01 20:45:44 +02:00
parent 489d081d35
commit 840c5b6f2a
9 changed files with 282 additions and 38 deletions

View File

@@ -1,5 +1,49 @@
<?php
class ContractFile extends mfBaseModel {
public function isImage() {
if(!$this->id) {
return false;
}
$file = $this->getProperty("file");
if(preg_match('#^image/#i', $file->mimetype)) {
return true;
}
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;
}
}