30 lines
602 B
PHP
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;
|
|
}
|
|
|
|
} |