id) { $id = $this->id; // delete file in store if($this->ubfolder) { $path = MFUPLOAD_FILE_SAVE_PATH."/".$this->subfolder."/".$this->store_filename; } else { $path = MFUPLOAD_FILE_SAVE_PATH."/".$this->store_filename; } if(!unlink($path)) { $this->log->warn(__CLASS__."::delete(): Error unlinking file ($path)"); } $where = "id=$id"; if($this->fieldprefix && !strstr($field,"_")) { $where = $this->fieldprefix."_id=$id"; } if($this->db->delete($this->table,$where)) { if(method_exists($this, "afterDelete")) { $this->afterDelete(); } $this->data = new stdClass(); $this->id = ""; return true; } } return false; } public function getProperty($name) { if($this->$name == null) { if(!$this->id) { return null; } if($name == "creator") { $this->creator = new User($this->create_by); return $this->creator; } if($name == "editor") { $this->editor = new User($this->edit_by); return $this->editor; } $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; } }