Files
thetool/application/ContractconfigGroup/ContractconfigGroup.php
2022-02-15 20:41:59 +01:00

30 lines
602 B
PHP

<?php
class ContractconfigGroup extends mfBaseModel {
private $items;
private $value;
public function getProperty($name) {
if($this->$name == null) {
if($name == "items") {
$this->items = ContractconfigItemModel::search(['group_id' => $this->id]);
return $this->items;
}
$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;
}
}