Added Order Form and File
This commit is contained in:
@@ -2,4 +2,30 @@
|
||||
|
||||
class File extends mfBaseModel {
|
||||
|
||||
|
||||
public function delete() {
|
||||
if($this->id) {
|
||||
$id = $this->id;
|
||||
|
||||
// delete file in store
|
||||
$path = MFUPLOAD_FILE_SAVE_PATH."/documents/".$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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user