本文整理汇总了PHP中Review::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::delete方法的具体用法?PHP Review::delete怎么用?PHP Review::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Review
的用法示例。
在下文中一共展示了Review::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectToEncryptedMySQL
<?php
require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "review.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/jfindley2.ini");
$review = new Review(null, 1, 2, "It was ok", 1, null);
$review->insert($pdo);
$review->setReviewText("It was decent");
$review->update($pdo);
$review->delete($pdo);
示例2: Cuisine
function test_delete()
{
$name = "Asian";
$id = null;
$test_cuisine = new Cuisine($name, $id);
$test_cuisine->save();
$restaurant_name = "The Golden Duck";
$location = "898 SW 5th Ave, Portland, OR";
$description = "A Chill Asian experince";
$price = "\$\$";
$cuisine_id = $test_cuisine->getId();
$test_restaurant = new Restaurant($restaurant_name, $location, $description, $price, $cuisine_id);
$test_restaurant->save();
$user = "yoloswag1959";
$stars = 3;
$headline = "It is aight.";
$body = "Yeah, pretty aight bro";
$restaurant_id = $test_restaurant->getId();
$test_review = new Review($user, $stars, $headline, $body, $restaurant_id);
$test_review->save();
$user2 = "6969babygirl";
$stars2 = 3;
$headline2 = "XOXO";
$body2 = "I cant even";
$restaurant_id2 = $test_restaurant->getId();
$test_review2 = new Review($user2, $stars2, $headline2, $body2, $restaurant_id2);
$test_review2->save();
$test_review->delete();
$result = Review::getAll();
//var_dump($result);
$this->assertEquals($test_review2, $result[0]);
}