本文整理汇总了PHP中Restaurant::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::add方法的具体用法?PHP Restaurant::add怎么用?PHP Restaurant::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Restaurant
的用法示例。
在下文中一共展示了Restaurant::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddRestaurant
public function testAddRestaurant()
{
$myRest = new Restaurant("23", "12", true, "Rue du test unitaire", "AGILE", "Superbe resto qui s'emmerde a faire des tests unitaire.", "Unit tests", "32456", "http://www.facebook.com");
$objectId = $myRest->add();
$query = new ParseQuery("Restaurant");
$query->equalTo("objectId", $objectId);
$results = $query->find();
$this->assertEquals(1, count($results));
$resto = $results[0];
$this->assertEquals("Rue du test unitaire", $resto->get("address"));
$this->assertEquals("AGILE", $resto->get("city"));
$this->assertEquals("Superbe resto qui s'emmerde a faire des tests unitaire.", $resto->get("description"));
$this->assertEquals("Unit tests", $resto->get("name"));
$this->assertEquals("32456", $resto->get("postal"));
$this->assertEquals("http://www.facebook.com", $resto->get("website"));
}
示例2: Restaurant
<?php
include_once "../Methods/Restaurant.php";
if (isset($_POST)) {
echo var_dump($_POST);
$myRest = new Restaurant($_POST['latitude'], $_POST['longitude'], $_POST['fast'], $_POST['adresse'], $_POST['city'], $_POST['description'], $_POST['name'], $_POST['postal'], $_POST['website']);
$myRest->add();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="bootstrap.css" rel="stylesheet" media="all" type="text/css">
<link href="bootstrap-slider-master/css/bootstrap-slider.css" rel="stylesheet">
<link href="bootstrap-slider-master/dependencies/css/bootstrap.min.css" rel="stylesheet">
<link href="style.css" rel="stylesheet" media="all" type="text/css">
<title>Ajouter un restaurant</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<img class="logo" src="logo.FindUSCook.png">
<form action="/FindUsCook/add.php" method="post">