当前位置: 首页>>代码示例>>PHP>>正文


PHP Key::delete方法代码示例

本文整理汇总了PHP中Key::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Key::delete方法的具体用法?PHP Key::delete怎么用?PHP Key::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Key的用法示例。


在下文中一共展示了Key::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drop

 public static function drop($key_id)
 {
     $key = new Key($key_id);
     return $key->delete();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:5,代码来源:Key.php

示例2: kill

 public function kill()
 {
     $this->clearPins();
     $db = new PHPWS_DB('block');
     $db->addWhere('id', $this->id);
     $result = $db->delete();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
     }
     $key = new Key($this->key_id);
     $result = $key->delete();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:15,代码来源:Block_Item.php

示例3: kill

 function kill()
 {
     if (!Current_User::authorized('wiki', 'delete_page')) {
         Current_User::disallow(dgettext('wiki', 'User attempted access to wiki page delete.'));
         return;
     }
     if (isset($_REQUEST['yes'])) {
         $db = new PHPWS_DB('wiki_pages');
         $db->addWhere('id', $this->getId());
         if (PHPWS_Error::logIfError($db->delete())) {
             WikiManager::sendMessage(dgettext('wiki', 'Page could not be deleted.'), array('page' => $this->getTitle(FALSE)), FALSE);
         }
         PHPWS_Core::initModClass('version', 'Version.php');
         Version::flush('wiki_pages', $this->getId());
         $key = new Key($this->key_id);
         PHPWS_Error::logIfError($key->delete());
         WikiManager::sendMessage(sprintf(dgettext('wiki', '%s deleted!'), $this->getTitle()), array(), FALSE);
     } else {
         if (isset($_REQUEST['no'])) {
             WikiManager::sendMessage(sprintf(dgettext('wiki', '%s was not deleted!'), $this->getTitle()), array('page' => $this->getTitle(FALSE)), FALSE);
         } else {
             $tags = array();
             $tags['MESSAGE'] = dgettext('wiki', 'Are you sure you want to delete this wiki page?');
             $tags['YES'] = PHPWS_Text::secureLink(dgettext('wiki', 'Yes'), 'wiki', array('page_op' => 'delete', 'yes' => 1, 'page' => $this->getTitle(FALSE)));
             $tags['NO'] = PHPWS_Text::secureLink(dgettext('wiki', 'No'), 'wiki', array('page_op' => 'delete', 'no' => 1, 'page' => $this->getTitle(FALSE)));
             $tags['WIKIPAGE'] = $this->view();
             return PHPWS_Template::process($tags, 'wiki', 'confirm.tpl');
         }
     }
 }
开发者ID:Jopperi,项目名称:wiki,代码行数:30,代码来源:WikiPage.php

示例4: delete

 public function delete()
 {
     if ($this->ftype == IMAGE_FOLDER) {
         $table = 'images';
     } elseif ($this->ftype == DOCUMENT_FOLDER) {
         $table = 'documents';
     } elseif ($this->ftype == MULTIMEDIA_FOLDER) {
         $table = 'multimedia';
     } else {
         return false;
     }
     /**
      * Delete file associations inside folder
      */
     $db = new PHPWS_DB('fc_file_assoc');
     $db->addWhere($table . '.folder_id', $this->id);
     $db->addWhere($table . '.id', 'fc_file_assoc.file_id');
     PHPWS_Error::logIfError($db->delete());
     /**
      * Delete the special folder associations to this folder
      */
     $db->reset();
     $db->addWhere('file_type', FC_IMAGE_FOLDER, '=', 'or', 1);
     $db->addWhere('file_type', FC_IMAGE_LIGHTBOX, '=', 'or', 1);
     $db->addWhere('file_type', FC_IMAGE_RANDOM, '=', 'or', 1);
     $db->addWhere('file_type', FC_DOCUMENT_FOLDER, '=', 'or', 1);
     $db->addWhere('file_id', $this->id);
     PHPWS_Error::logIfError($db->delete());
     /**
      * Delete the files in the folder from the db
      */
     unset($db);
     $db = new PHPWS_DB($table);
     $db->addWhere('folder_id', $this->id);
     PHPWS_Error::logIfError($db->delete());
     /**
      * Delete the folder from the database
      */
     $db = new PHPWS_DB('folders');
     $db->addWhere('id', $this->id);
     PHPWS_Error::logIfError($db->delete());
     /**
      * Delete the key
      */
     $key = new Key($this->key_id);
     $key->delete();
     /**
      * Delete the physical directory the folder occupies
      */
     $directory = $this->getFullDirectory();
     if (is_dir($directory)) {
         PHPWS_File::rmdir($directory);
     }
     return true;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:55,代码来源:Folder.php

示例5: delete

 public function delete()
 {
     $all_is_well = true;
     $db = new PHPWS_DB('blog_entries');
     $db->addWhere('id', $this->id);
     $result = $db->delete();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         $all_is_well = false;
     }
     $key = new Key($this->key_id);
     $key->delete();
     return $all_is_well;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:14,代码来源:Blog.php


注:本文中的Key::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。