Files
thetool/application/IvtProductMatch/IvtProductMatch.php
2023-10-03 20:02:13 +02:00

36 lines
901 B
PHP

<?php
class IvtProductMatch extends mfBaseModel {
private $product;
private $ivtproduct;
public function getProperty($name) {
if($this->$name == null) {
if($name == "ivtproduct") {
$ivtproduct = new IvtProduct($this->ivt_product_id);
if($ivtproduct->id) {
$this->ivtproduct = $ivtproduct;
}
return $this->ivtproduct;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
if(!$this->$name) {
$this->$name = new $classname($this->$idfield);
}
if($this->$name->id) {
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}