Added Contractconfig Edit
This commit is contained in:
@@ -10,6 +10,7 @@ class Contract extends mfBaseModel {
|
||||
private $contractConfigGroups;
|
||||
private $contractConfigItems;
|
||||
private $configgroups;
|
||||
private $isCancelled;
|
||||
private $links;
|
||||
private $linkFrom;
|
||||
private $linkTo;
|
||||
@@ -86,22 +87,24 @@ class Contract extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*$this->links = mfValuecache::singleton()->get("ContractLinks-origin-".$this->id);
|
||||
if(!$this->links) {
|
||||
$this->links = [];
|
||||
foreach(ContractLinkModel::search(["origin_contract_id" => $this->id]) as $link) {
|
||||
if(array_key_exists($link->type, $this->links)) {
|
||||
$this->links[$link->type] = [];
|
||||
}
|
||||
$this->links[$link->type][] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function isCancelled() {
|
||||
if(!$this->id) {
|
||||
return false;
|
||||
}
|
||||
if(count($this->links)) {
|
||||
mfValuecache::singleton()->set("ContractLinks-origin-".$this->id, $this->links);
|
||||
|
||||
if(!$this->cancel_date) {
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
$now = date('U');
|
||||
if($this->cancel_date < $now) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
@@ -186,6 +189,7 @@ class Contract extends mfBaseModel {
|
||||
|
||||
if($name == "links") {
|
||||
$this->links = ContractLinkModel::includesContractId($this->id, ["type" => $link]);
|
||||
//var_dump($this->links);exit;
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user