本文整理汇总了PHP中article::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP article::delete方法的具体用法?PHP article::delete怎么用?PHP article::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类article
的用法示例。
在下文中一共展示了article::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: article
<?php
if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
$object_article = new article();
$object_article->setId($_REQUEST['i']);
if ($object_article->delete()) {
print 'sucess';
} else {
print 'error';
}
} else {
print 'error';
}
示例2: article
/**
* Cnews::copy_2_cat()
*
* @param mixed $id
* @return
*/
function copy_2_cat($id)
{
$this->load->helper('remove_vn_helper');
$news = new article($id);
if (!$news->exists()) {
show_404();
}
$cat_id = $news->newscatalogue_id;
$copy_newscatalogue = $this->input->post('copy_newscatalogue');
$copy_type = $this->input->post('copy_type');
$copy_amount = $this->input->post('copy_amount');
$flag_error = false;
if ($copy_newscatalogue == 0) {
$newscatalogue = new newscatalogue();
$newscatalogue->where('id !=', $news->newscatalogue_id);
$newscatalogue->get();
$vb = new article();
$vb->hot = 0;
$vb->home_hot = 0;
foreach ($newscatalogue as $row) {
for ($i = 0; $i < $copy_amount; $i++) {
$vb = $news->get_copy();
$vb->code = "";
if (!$vb->save(array($row))) {
foreach ($vb->error->all as $r) {
flash_message('error', $r);
$flag_error = true;
}
} else {
$vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese;
$vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id);
$vb->save();
}
$vb->clear();
}
}
} else {
$newscatalogue = new newscatalogue($copy_newscatalogue);
$vb = new article();
$vb->hot = 0;
$vb->home_hot = 0;
for ($i = 0; $i < $copy_amount; $i++) {
$vb = $news->get_copy();
$vb->code = "";
if (!$vb->save(array($newscatalogue))) {
foreach ($vb->error->all as $r) {
flash_message('error', $r);
$flag_error = true;
}
} else {
$vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese;
$vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id);
$vb->save();
}
$vb->clear();
}
}
if ($copy_type == "move") {
$news->delete();
}
if ($flag_error == false) {
flash_message('success', "Thực hiện thành công xong copy/move");
} else {
flash_message('info', "Có 1 vài lỗi trên");
}
redirect($this->admin . 'cnews/edit/' . $cat_id . '/' . $id);
}
示例3: foreach
foreach ($itemid as $v) {
$do->update($v);
}
dmsg('更新成功', $forward);
break;
case 'tohtml':
is_array($itemid) or msg('请选择' . $MOD['name']);
$html_itemids = $itemid;
foreach ($html_itemids as $itemid) {
tohtml('show', $module);
}
dmsg('更新成功', $forward);
break;
case 'delete':
$itemid or msg('请选择' . $MOD['name']);
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
dmsg('删除成功', $forward);
break;
case 'restore':
$itemid or msg('请选择' . $MOD['name']);
$do->restore($itemid);
dmsg('还原成功', $forward);
break;
case 'clear':
$do->clear();
dmsg('清空成功', $forward);
break;
case 'level':
$itemid or msg('请选择' . $MOD['name']);
$level = intval($level);
$do->level($itemid, $level);