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


PHP Item::deleteItem方法代码示例

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


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

示例1: deleteItem

function deleteItem($id)
{
    global $bdd, $_TABLES;
    if (!is_null($bdd) && !is_null($_TABLES)) {
        $objItem = new Item($bdd, $_TABLES);
        $objItem->deleteItem($id);
    } else {
        error_log("BDD ERROR : " . json_encode($bdd));
        error_log("TABLES ERROR : " . json_encode($_TABLES));
    }
}
开发者ID:xXNoceboXx,项目名称:WUS,代码行数:11,代码来源:item.controller.php

示例2: foreach

            echo "<ul>";
            echo $object->name;
            foreach ($object->subItem as $k => $ob) {
                if (!in_array($ob, self::getCategory())) {
                    echo "<li>";
                    echo "<a href=\"" . $ob->url . "\">" . $ob->name . "</a>";
                    echo "</li>";
                }
            }
            echo "</ul>";
        }
    }
}
$menu = new Item("Menu");
for ($i = 1; $i <= 3; $i++) {
    Item::addSubItem("Menu", "Point " . $i);
}
for ($i = 1; $i <= 3; $i++) {
    Item::addSubItem("Point 1", "Point 1-" . $i);
    Item::addSubItem("Point 2", "Point 2-" . $i);
}
Item::setUrl("Point 2", "www.ya.ru");
Item::setUrl("Point 2-1", "www.google.com");
Item::setUrl("Point 2-2", "www.ya.ru");
Item::addSubItem("Point 2-1", "Point 2-1-1");
Item::renameItem("Point 2", "Поисковики");
Item::renameItem("Point 2-1", "Google");
Item::renameItem("Point 2-2", "Yandex");
Item::deleteItem("Point 2-3");
Item::realize();
var_dump(Item::$AllItems);
开发者ID:vetero4eg,项目名称:vetero4eg.github.com,代码行数:31,代码来源:index.php

示例3: die

<?php 
require_once "Item.php";
require_once "User.php";
session_start();
if (isset($_SESSION['idList'])) {
    $idList = $_SESSION['idList'];
    //obtenemos el id de la lista a partir de la variable SESSION
} else {
    die('No se ha seleccionado una lista');
}
if (isset($_SESSION['idItem'])) {
    $idItem = $_SESSION["idItem"];
    //obtenemos el id del item a partir de la variable SESSION
} else {
    die('No se ha seleccionado un item');
}
//comprobamos que el usuario se ha autenticado y pertenece al grupo en cuya lista se encuentra el item eliminar
$currentUser = User::getLoggedInUser();
if (!$currentUser) {
    die('Necesitas autenticarte para acceder a esta funcionalidad');
}
if (!Item::userBelongsToGroupOfItemList($currentUser->id, $idList, $idItem)) {
    die("No perteneces al grupo de la lista cuyo item quieres editar");
}
$item = new Item();
$item->idItem = $idItem;
$item->deleteItem();
开发者ID:ricardo101289,项目名称:sharedslist,代码行数:27,代码来源:delete_item.php

示例4: Item

<?php

include '../class/item.class.php';
$item = new Item();
if ($_POST) {
    if ($_POST['tipo'] == 'add') {
        $nome = $_POST['nome'];
        $type = $_POST['type'];
        $minimo = $_POST['minimo'];
        $item->addItem($nome, $type, $minimo);
    } elseif ($_POST['tipo'] == 'del') {
        $key = $_POST['key'];
        $item->deleteItem($key);
    }
}
开发者ID:JeanGoncalves,项目名称:coffeeList,代码行数:15,代码来源:action.item.php

示例5: clear

<?php

require_once 'includes/functions.php';
if (isset($_POST) && !empty($_POST)) {
    $item_order = clear($_POST['item_order']);
    $url = clear($_POST['url']);
    $list_name = clear($_POST['list_name']);
    unset($_POST);
    //	delete_list
    if (!empty($item_order)) {
        Item::deleteItem($item_order);
    }
    //add_list
    if (!empty($url) && !empty($list_name)) {
        Item::addItem($url, $list_name);
    }
    //update_list
    if (!empty($item_order) && !empty($url) && !empty($list_name)) {
        Item::updateItem($item_order, $url, $list_name);
    }
    //drug & drop save result
    /*	$i = 0;
    
    		foreach ($_POST['item'] as $value) {
    			// Execute statement:
    			// UPDATE [Table] SET [Position] = $i WHERE [EntityId] = $value
    			$i++;
    		}*/
    $items = Item::find_all();
    $output = '';
    foreach ($items as $item) {
开发者ID:ildargareev,项目名称:test_task_adme,代码行数:31,代码来源:response.php

示例6: header

            exit;
        }
        if (!isset($_POST['responseuri'])) {
            header("Location: restaurants");
            exit;
        }
        $responseuri = $_POST['responseuri'];
        if (!isset($_POST['id'])) {
            header("Location: restaurants");
            exit;
        }
        $itemid = $_POST['id'];
        try {
            $item = Item::get($itemid, $userid);
            $itemname = $item->getProperty('name');
            Item::deleteItem($itemid, $userid);
            $formmessage = 'Item "' . $itemname . '" deleted.';
            $formmessageclass = 'green';
            break;
        } catch (Exception $e) {
            $formmessage = $e->getMessage();
            trigger_error($formmessage);
            $formmessageclass = 'red';
            break;
        }
    } else {
        header("Location: logout");
        exit;
    }
} while (1 == 0);
include "common/sessionmessage.php";
开发者ID:auimendoza,项目名称:appfoodsyadmin,代码行数:31,代码来源:deleteitem.php

示例7: array

     //验证登录
     $item = array('id' => $id, 'typeid' => $typeid, 'lang' => $_REQUEST['lang'], 'content' => stripslashes($_REQUEST['text']), 'title' => $_REQUEST['title'], 'itemtime' => $_REQUEST['itemtime'], 'itemcreatetime' => date('Y-m-j G:i:s'), 'operator' => $currentUserInfo['idoperator'], 'club' => $_REQUEST['club']);
     //var_dump($item['content'],$_REQUEST['text']);
     // die();
     if ($id) {
         $result = Item::updateItem($item);
     } else {
         $result = Item::createItem($item);
     }
     if ($result) {
         $data = $result;
     }
     break;
 case 'delete':
     if ($id) {
         $result = Item::deleteItem($id);
         $code = $result['code'];
         $msg = $result['msg'];
         $data = $result['data'];
     } else {
         $code = 1;
         $msg = "无效的id";
     }
     break;
 case 'get':
     $result = Item::getItemByID($id);
     $code = $result['code'];
     $msg = $result['msg'];
     $data = $result['data'][0];
     break;
 case 'list':
开发者ID:cmooony,项目名称:d4d-studio,代码行数:31,代码来源:item.php


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