本文整理匯總了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);
});
});