本文整理汇总了PHP中Restaurant::deleteRestaurant方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::deleteRestaurant方法的具体用法?PHP Restaurant::deleteRestaurant怎么用?PHP Restaurant::deleteRestaurant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Restaurant
的用法示例。
在下文中一共展示了Restaurant::deleteRestaurant方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Restaurant
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/model/restaurant.php";
$restaurant = new Restaurant();
print_r($restaurant->deleteRestaurant($_POST['id']));
?>
示例2: header
exit;
}
$action = $_POST['action'];
if ($action != 'deleterestaurant') {
header("Location: logout");
exit;
}
if (!isset($_POST['id'])) {
header("Location: restaurants");
exit;
}
$restaurantid = $_POST['id'];
try {
$restaurant = Restaurant::get($restaurantid, $userid);
$restaurantname = $restaurant->getProperty('name');
Restaurant::deleteRestaurant($restaurantid, $userid);
$formmessage = 'Restaurant "' . $restaurantname . '" 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";