当前位置: 首页>>代码示例>>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;未经允许,请勿转载。