Files
thetool/application/Preorderlogistics/Preorderlogistics.php
2025-03-25 17:13:08 +01:00

40 lines
925 B
PHP

<?php
class Preorderlogistics extends mfBaseModel {
private $qrfilename;
private $preorder;
public function getProperty($name) {
if($this->$name == null) {
if($name == "qrfilename") {
$preorder = $this->getProperty("preorder");
if(!$this->preorder_id || !$preorder || !$preorder->ucode) {
return false;
}
$filename = "preorder-cif-".$preorder->ucode.".png";
$this->qrfilename = $filename;
return $this->qrfilename;
}
if($name == "sender") {
$this->sender = new User($this->sent_by);
return $this->sender;
}
$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;
}
}