當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Content::delete方法代碼示例

本文整理匯總了PHP中Content::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::delete方法的具體用法?PHP Content::delete怎麽用?PHP Content::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Content的用法示例。


在下文中一共展示了Content::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 public function delete()
 {
     if (in_array($_GET['id'], array('1', '2'))) {
         $this->error('本部門不允許刪除');
     }
     parent::delete();
 }
開發者ID:tarscoding,項目名稱:PESCMS-TEAM,代碼行數:7,代碼來源:Department.class.php

示例2: afterDelete

 public function afterDelete()
 {
     if ($this->content !== null) {
         $this->content->delete();
     }
     parent::afterDelete();
 }
開發者ID:alefernie,項目名稱:intranet,代碼行數:7,代碼來源:HActiveRecordContent.php

示例3: delete

 function delete($id = FALSE)
 {
     if ($id) {
         $content = new Content($id);
         $content->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
開發者ID:unisexx,項目名稱:imac,代碼行數:9,代碼來源:contents.php

示例4: delete

 /**
  * Deletes a profile and associated users
  */
 public function delete()
 {
     $this->db->query('DELETE FROM `login` 
     WHERE `profile_id`=' . intval($this->data['id']), \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     $this->db->query('DELETE FROM `facebook_graph` 
     WHERE `userID` IN (SELECT `userID` FROM `facebook` WHERE `profile_id`=' . intval($this->data['id']) . ')', \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     $this->db->query('DELETE FROM `facebook` 
     WHERE `profile_id`=' . intval($this->data['id']), \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     parent::delete();
 }
開發者ID:caiofior,項目名稱:cercaziende,代碼行數:13,代碼來源:Profile.php

示例5: delete

 public function delete()
 {
     if (in_array($_GET['id'], array('1'))) {
         $this->error('初始用戶不允許刪除');
     }
     /**
      * 將被刪除用戶的任務設置為刪除狀態
      * 這樣做是為了保留數據統計的完整性
      */
     $this->db('task')->where('task_user_id = :task_user_id')->update(array('noset' => array('task_user_id' => $_GET['id']), 'task_delete' => '1'));
     parent::delete();
 }
開發者ID:tarscoding,項目名稱:PESCMS-TEAM,代碼行數:12,代碼來源:User.class.php

示例6: delete

 /**
  * calls Content::delete() to soft delete a content
  * Soft delete is being performed here
  * set $this->content_id at the time of calling this method
  */
 public function delete()
 {
     Logger::log("Enter: Announcement::delete");
     Logger::log("Calling: Content::delete");
     $sql = 'UPDATE { announcements } SET is_active = ?, position = ?, status = ? WHERE content_id = ?';
     $data = array(0, 0, 0, $this->content_id);
     $res = Dal::query($sql, $data);
     parent::delete();
     Logger::log("Exit: Announcement::delete");
     return;
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:16,代碼來源:Announcement.php

示例7: delete

 /**
  * Deletes a File object
  *
  * @param string $errmsg Reference to error message
  *
  * @return bool True if deletion was successful
  * @internal Persistent content will not be deleted
  */
 public function delete(&$errmsg)
 {
     if ($this->isPersistent() == false) {
         // Unlink BLOB if any exists
         $blob_oid = $this->getBinaryDataOid();
         if ($blob_oid) {
             $errmsg = "Deleting BLOB OID : {$blob_oid}";
             if ($this->mBd->UnlinkLargeObject($blob_oid) == false) {
                 $errmsg = _("Unable to successfully unlink BLOB OID : {$blob_oid} !");
                 return false;
             }
         }
         $this->mBd->execSqlUpdate("DELETE FROM content_file WHERE files_id = '" . $this->getId() . "'", false);
     } else {
         $errmsg = _("Could not delete this file, since it is persistent");
     }
     return parent::delete($errmsg);
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:26,代碼來源:File.php

示例8: delete

 public function delete()
 {
     parent::delete();
     Navigation::redirect("admin/menu_top");
     exit;
 }
開發者ID:reytuty,項目名稱:facil,代碼行數:6,代碼來源:MenuTop.php

示例9: delete

 /**
  * delete sb content in the object
  * @access public
  */
 public function delete()
 {
     Logger::log("Enter: SBMicroContent::delete | Arg: \$content_id = {$content_id}");
     Logger::log("Calling: Content::delete | Param: \$content_id = {$content_id}");
     parent::delete();
     $sql = "DELETE FROM {contents_sbmicrocontents} WHERE content_id = ? ";
     $data = array($this->content_id);
     $res = Dal::query($sql, $data);
     if (PEAR::isError($res)) {
         Logger::log(" Throwing exception DB_QUERY_FAILED | Message: {$res->getMessage}()", LOGGER_ERROR);
         throw new PAException(DB_QUERY_FAILED, $res->getMessage());
     }
     Logger::log("Exit: SBMicrocontent::delete");
     return;
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:19,代碼來源:SBMicroContent.php

示例10: delete

 /**
  * 刪除 
  */
 public function delete()
 {
     if (IS_POST) {
         $catid = (int) $this->_get("catid");
         if (!$catid) {
             $this->error("缺少欄目ID!");
         }
         if (empty($_POST['ids'])) {
             $this->error("沒有信息被選中!");
         }
         import('Content');
         $Content = new Content();
         foreach ($_POST['ids'] as $id) {
             $Content->delete($id, $catid);
         }
         $this->success("刪除成功!");
     } else {
         $catid = (int) $this->_get("catid");
         $id = (int) $this->_get("id");
         if (!$catid) {
             $this->error("缺少欄目ID!");
         }
         //檢查是否鎖定
         $this->locking($catid, $id);
         import('Content');
         $Content = new Content();
         if ($Content->delete($id, $catid)) {
             $this->success("刪除成功!");
         } else {
             $this->error("刪除失敗!");
         }
     }
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:36,代碼來源:ContentAction.class.php

示例11: Comments

<?php

require_once "../bd.php";
// Include connect to BD
require_once '../classes/base.php';
// Include main classes
//If DELETE comment
if (isset($_GET['name']) == 'comment') {
    $id = $_GET['id'];
    $deleteObject = new Comments();
    if ($deleteObject->delete($id)) {
        echo '<script>window.location.href="../index.php"</script>';
    } else {
        echo 'False';
    }
}
//If DELETE etries
if (isset($_GET['name']) == 'entries') {
    $id = $_GET['id'];
    $deleteObject = new Content();
    if ($deleteObject->delete($id)) {
        echo '<script>window.location.href="../index.php"</script>';
    } else {
        echo 'False';
    }
}
開發者ID:ViktorLomakin,項目名稱:work,代碼行數:26,代碼來源:delete.php

示例12: delete

 /**
  * 刪除 
  */
 public function delete()
 {
     $id = (int) $this->_get("id");
     $catid = (int) $this->_get("catid");
     $member_content = M("MemberContent");
     $mb_con = $member_content->where(array("content_id" => $id, "catid" => $catid, "userid" => AppframeAction::$Cache['uid']))->find();
     if ($mb_con) {
         $category = $this->categorys[$catid];
         $setting = unserialize($category['setting']);
         //模型ID
         $modelid = $category['modelid'];
         $tablename = ucwords($this->Model[$modelid]['tablename']);
         $status = M($tablename)->where(array("id" => $id, "catid" => $catid, "sysadd" => 0))->getField("status");
         if ($status) {
             //審核通過的文章
             if ($status == 99) {
                 if ((int) $setting['member_admin'] == 4 || (int) $setting['member_admin'] == 6) {
                     import('Content');
                     $Content = new Content();
                     if ($Content->delete($id, $catid)) {
                         $this->success("刪除成功!");
                     } else {
                         $this->error("刪除失敗!");
                     }
                 } else {
                     $this->error("你沒有權限操!");
                 }
             } else {
                 if ((int) $setting['member_admin'] == 1 || (int) $setting['member_admin'] == 3 || (int) $setting['member_admin'] == 6) {
                     import('Content');
                     $Content = new Content();
                     if ($Content->delete($id, $catid)) {
                         $this->success("刪除成功!");
                     } else {
                         $this->error("刪除失敗!");
                     }
                 } else {
                     $this->error("你沒有權限操!");
                 }
             }
         } else {
             $this->error("出現錯誤,係統找不到該信息的相關記錄!");
         }
     } else {
         $this->error("該信息不存在!");
     }
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:50,代碼來源:ContentAction.class.php

示例13: deleteAction

 /** Delete article
  */
 public function deleteAction()
 {
     if ($this->_request->isPost()) {
         $id = (int) $this->_request->getPost('id');
         $del = $this->_request->getPost('del');
         if ($del == 'Yes' && $id > 0) {
             $contents = new Content();
             $where = 'id = ' . $id;
             $contents->delete($where);
             $this->_flashMessenger->addMessage('Record deleted!');
             $this->_helper->solrUpdater->deleteById('beocontent', $id);
         }
         $this->_redirect('/admin/content/');
     } else {
         $id = (int) $this->_request->getParam('id');
         if ($id > 0) {
             $contents = new Content();
             $this->view->content = $contents->fetchRow('id=' . $id);
         }
     }
 }
開發者ID:rwebley,項目名稱:Beowulf---PAS,代碼行數:23,代碼來源:ContentController.php

示例14: delete

 /** Delete this Content from the database */
 public function delete(&$errmsg)
 {
     $user = User::getCurrentUser();
     if (!$this->DEPRECATEDisOwner($user) || !$user->DEPRECATEDisSuperAdmin()) {
         $errmsg = _('Access denied!');
     }
     if ($this->isPersistent() == false) {
         $this->mBd->execSqlUpdate("DELETE FROM content_flickr_photostream WHERE flickr_photostream_id = '" . $this->getId() . "'", false);
     }
     return parent::delete($errmsg);
 }
開發者ID:soitun,項目名稱:wifidog-auth,代碼行數:12,代碼來源:FlickrPhotostream.php

示例15: delete

 public function delete()
 {
     parent::delete();
     Navigation::redirect($this->my_redirect);
     exit;
 }
開發者ID:reytuty,項目名稱:facil,代碼行數:6,代碼來源:Page.php


注:本文中的Content::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。