本文整理汇总了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));
}
}
示例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);
示例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();
示例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);
}
}
示例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) {
示例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";
示例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':