object_id = $object_id; return true; } public function getProperty($name) { if($this->$name == null) { if($name == "value") { if(!$this->object_id) { $this->log->warn(__CLASS__."::getProperty('value'): Object ID not set"); return null; } $value = WorkflowvalueModel::getFirst(['item_id' => $this->id, "object_id" => $this->object_id]); if(!$value) { $vdata['item_id'] = $this->id; $vdata['object_id'] = $this->object_id; $value = WorkflowvalueModel::create($vdata); } $this->value = $value; return $this->value; } $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; } }