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


PHP Item::Delete方法代码示例

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


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

示例1: Delete

 public function Delete()
 {
     if (!$this->Exist()) {
         return false;
     }
     if ($this->initParent()) {
         $this->parent_obj->OnDeleteComment();
     }
     return parent::Delete();
 }
开发者ID:qexyorg,项目名称:webMCR-1,代码行数:10,代码来源:comment.class.php

示例2: Delete

 public function Delete()
 {
     global $bd_names;
     if (!$this->Exist()) {
         return false;
     }
     $skin_way = $this->base_dir . $this->fname;
     $preview_way = $this->base_dir . 'preview/' . $this->fname;
     $result = BD("SELECT `hash` FROM `{$this->db}` WHERE `id`='" . $this->id . "'");
     if (mysql_num_rows($result)) {
         $line = mysql_fetch_array($result);
         BD("INSERT INTO {$this->db_bad_skins} (hash) VALUES ('" . $line['hash'] . "')");
     }
     if (file_exists($skin_way)) {
         unlink($skin_way);
     }
     if (file_exists($preview_way)) {
         unlink($preview_way);
     }
     BD("DELETE FROM `{$this->db_likes}` WHERE `item_id`='" . $this->id . "' AND `item_type`='" . ItemType::Skin . "'");
     BD("LOCK TABLES `{$this->db_ratio}` WRITE;");
     BD("UPDATE `{$this->db_ratio}` SET `num` = num - 1 WHERE `ratio`='" . $this->ratio . "'");
     BD("UNLOCK TABLES;");
     return parent::Delete();
 }
开发者ID:saneriner,项目名称:webMCR-SkinPoser,代码行数:25,代码来源:skinposer.class.php

示例3: Delete

 public function Delete()
 {
     global $user, $bd_names;
     if (empty($user) or !$user->getPermission('add_news') or !$this->Exist()) {
         return false;
     }
     $result = getDB()->ask("SELECT `id` FROM `{$bd_names['comments']}` " . "WHERE `item_id`='" . $this->id . "' AND `item_type` = '" . $this->type() . "'");
     loadTool('comment.class.php');
     while ($line = $result->fetch('num')) {
         $comments_item = new Comments_Item($line[0], false);
         $comments_item->Delete();
         unset($comments_item);
     }
     getDB()->ask("DELETE FROM `{$bd_names['likes']}` " . "WHERE `item_id` = '" . $this->id . "' AND `item_type` = '" . $this->type() . "'");
     return parent::Delete();
 }
开发者ID:qexyorg,项目名称:webMCR-1,代码行数:16,代码来源:catalog.class.php

示例4: testFindAllItems

 public function testFindAllItems()
 {
     $items_before = Item::GetAll();
     $item = Item::CreateAsset('Test Item Name Additional', 120, 10, '', 120);
     $items_after = Item::GetAll();
     $this->assertTrue(count($items_after) == count($items_before) + 1);
     foreach ($items_after as $itm) {
         $this->assertInstanceOf('Item', $itm);
     }
     Item::Delete($item->id);
     $post_after = Item::GetAll();
     $this->assertTrue(count($post_after) == count($items_before));
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:13,代码来源:InventoryTest.php

示例5: PageContent

// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    $objItem = new Item($id);
    $category = new Category($objItem->CategoryId);
    header("Location:item_list.php?cat=" . $category->Id);
    exit;
}
if ($_POST['commit'] == "Delete Item") {
    $objItem = new Item($id);
    $category = new Category($objItem->CategoryId);
    $objItem->Delete($id);
    header("Location:item_list.php?cat=" . $category->Id);
    exit;
}
$objItem = new Item($id);
$category = new Category($objItem->CategoryId);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objItem;
    global $category;
    global $id;
    ?>

            <div class="layout laymidwidth">
开发者ID:brandfeverinc,项目名称:coke-cooler,代码行数:30,代码来源:item_delete.php

示例6: deleteItem

 public function deleteItem($id)
 {
     if (Item::Delete($id)) {
         echo 1;
     } else {
         echo 0;
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:8,代码来源:index.php


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