本文整理匯總了PHP中file_storage::action_delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP file_storage::action_delete方法的具體用法?PHP file_storage::action_delete怎麽用?PHP file_storage::action_delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類file_storage
的用法示例。
在下文中一共展示了file_storage::action_delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: files
function action_delete()
{
log_debug("journal_process", "Executing action_delete()");
/*
Start Transaction
*/
$sql_obj = new sql_query();
$sql_obj->trans_begin();
/*
Delete files (if applicable)
*/
if ($this->structure["type"] == "file") {
$file_obj = new file_storage();
$file_obj->data["type"] = "journal";
$file_obj->data["customid"] = $this->structure["id"];
$file_obj->load_data_bytype();
$file_obj->action_delete();
}
/*
Delete journal record
*/
$sql_obj->string = "DELETE FROM `journal` WHERE id='" . $this->structure["id"] . "' LIMIT 1";
$sql_obj->execute();
/*
Commit
*/
if (error_check()) {
log_write("error", "journal_process", "An error occured preventing the journal record from being deleted");
$sql_obj->trans_rollback();
return 0;
} else {
log_write("notification", "journal_process", "Journal record cleanly removed.");
$sql_obj->trans_commit();
return 1;
}
return 0;
}