本文整理汇总了PHP中MenuItem::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::delete方法的具体用法?PHP MenuItem::delete怎么用?PHP MenuItem::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxDeleteAction
/**
* Delete Menu Item
*/
public function ajaxDeleteAction()
{
$menuId = (int) $this->_getParam('menuId');
if ($menuId === 0) {
$msg = __("Deleting root menu is not allowed!");
} else {
// TODO: execute deletion of menu id, temporarily placed it here
// since ORM DELETE is not fully implemented
$objMenu = new MenuItem();
$objMenu->menuId = $menuId;
if ($objMenu->delete()) {
$msg = __("Successfully deleted Menu Item: {$menuId}");
} else {
$msg = __("Failed to deleted Menu Item: {$menuId}");
}
}
$data = array('msg' => $msg);
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct($data);
}
示例2: delete
/**
* Deletes self and passes the call to parent class
* @see solidbase/lib/MenuItem#delete()
*/
function delete()
{
global $DB;
if ($this->mayI(DELETE)) {
$DB->metadata->delete($this->ID);
$DB->content->delete($this->ID, false);
$DB->spine->delete($this->ID);
return parent::delete();
} else {
return false;
}
}
示例3: MenuItem
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
require 'config.php';
require 'models/menu-item.class.php';
$menuItem = new MenuItem();
if (isset($_POST["delete_id"])) {
$id = $_POST['delete_id'];
$menuItem->delete($id);
} else {
if (isset($_POST['id'])) {
$name = $_POST['name'];
$description = $_POST['description'];
$price = $_POST['price'];
$id = $_POST['id'];
$menuItem->update($id, $name, $description, $price, 'lunch');
} else {
if (isset($_POST['add'])) {
$name = $_POST['name'];
$description = $_POST['description'];
$price = $_POST['price'];
$menuItem->create($name, $description, $price, 'lunch');
}
}
}
示例4: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy(MenuItem $menuItem)
{
/*$menuItem = MenuItem::findOrFail($id);*/
$menuItem->delete();
return Redirect::route('admin.menu.index')->withMessage("L'onglet a été supprimé");
}
示例5: ConsoleOption
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$menuCatObj = new MenuCategory($mysqli);
$menuItemObj = new MenuItem($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Menu Items");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
$memberInfo = $member->get_info_filtered();
if ($member->hasAccess($consoleObj) && $menuItemObj->select($_POST['itemID'])) {
$menuItemInfo = $menuItemObj->get_info_filtered();
if ($_POST['confirm'] == "1") {
$menuCatObj->select($menuItemInfo['menucategory_id']);
$refreshSection = $menuCatObj->get_info("section");
$menuItemObj->delete();
$menuItemObj->resortOrder();
include "include/menuitemlist.php";
/*
echo "
<script type='text/javascript'>
$(document).ready(function() {
$.post('".$MAIN_ROOT."themes/_refreshmenus.php', { refreshSectionID: '".$refreshSection."' }, function(data) {
$('#menuSection_".$refreshSection."').html(data);
});
});