本文整理汇总了PHP中Restaurant类的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant类的具体用法?PHP Restaurant怎么用?PHP Restaurant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Restaurant类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fest_allRestaurantsInCuisine
function fest_allRestaurantsInCuisine()
{
//Arrange
$cuisine = "Pizza";
$test_cuisine = new Cuisine($cuisine);
$test_cuisine->save();
$cuisine = "Burgers";
$test_cuisine2 = new Cuisine($cuisine);
$test_cuisine2->save();
$restaurant_name = "Antoons";
$cuisine_type = 1;
$restaurant_phone = "4128675309";
$restaurant_address = "123 Atwood St";
$test_Restaurant = new Restaurant($restaurant_name, $cuisine_type, $restaurant_phone, $restaurant_address);
$test_Restaurant->save();
$restaurant_name = "Spankys";
$cuisine_type = 2;
$restaurant_phone = "8015715713";
$restaurant_address = "379 E 3333 S";
$test_next_Restaurant = new Restaurant($restaurant_name, $cuisine_type, $restaurant_phone, $restaurant_address);
$test_next_Restaurant->save();
$restaurant_name = "Dave & Busters";
$cuisine_type = 1;
$restaurant_phone = "44444444";
$restaurant_address = "HELL";
$test_third_restaurant = new Restaurant($restaurant_name, $cuisine_type, $restaurant_phone, $restaurant_address);
$test_third_restaurant->save();
//Act
$result = Cuisine::getRestaurants();
//Assert
$this->assertEquals([$test_Restaurant, $test_third_restaurant], $result);
}
开发者ID:kellimargaret,项目名称:restaurants,代码行数:32,代码来源:CuisineTest.php
示例2: test_GetRestaurants
function test_GetRestaurants()
{
//Arrange
$name = "Drinks";
$id = null;
$test_cuisine = new Cuisine($name, $id);
$test_cuisine->save();
$restaurant = "Aalto";
$address = "123 Belmont";
$phone = "123-456-7890";
$cuisine_id = $test_cuisine->getId();
$id = 1;
$test_restaurant = new Restaurant($restaurant, $address, $phone, $cuisine_id, $id);
$test_restaurant->save();
$restaurant2 = "Aalto";
$address2 = "123 Belmont";
$phone2 = "123-456-7890";
$cuisine_id2 = $test_cuisine->getId();
$id = 2;
$test_restaurant2 = new Restaurant($restaurant, $address, $phone, $cuisine_id, $id);
$test_restaurant2->save();
//Act
$result = $test_cuisine->getRestaurants();
//Assert
$this->assertEquals([$test_restaurant, $test_restaurant2], $result);
}
开发者ID:sammartinez,项目名称:restaurant_project,代码行数:26,代码来源:CuisineTest.php
示例3: createTableRow
function createTableRow(Restaurant $rest)
{
print "<tr>\n";
print "<td>" . $rest->getRestName() . "</td>\n";
print "<td>" . $rest->getCuisName() . "</td>\n";
print "<td>" . $rest->getCityName() . "</td>\n";
print "<td>" . $rest->getPrngName() . "</td>\n";
print "</tr>\n";
}
开发者ID:alexandralomotan,项目名称:cs174,代码行数:9,代码来源:_restaurants.php
示例4: test_find
function test_find()
{
//Arrange
$restaurant_name = "Antoons";
$cuisine_type = 1;
$restaurant_phone = "4128675309";
$restaurant_address = "123 Atwood St";
$test_Restaurant = new Restaurant($restaurant_name, $cuisine_type, $restaurant_phone, $restaurant_address);
$test_Restaurant->save();
//Act
$result = Restaurant::find($test_Restaurant->getId());
//Assert
$this->assertEquals($test_Restaurant, $result);
}
开发者ID:kellimargaret,项目名称:restaurants,代码行数:14,代码来源:RestaurantTest.php
示例5: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Restaurant::create(['name' => $faker->company, 'latitude' => $faker->randomFloat(5, -90, 90), 'longitude' => $faker->randomFloat(5, -180, 180)]);
}
}
开发者ID:andrewhood125,项目名称:smart-buzzer,代码行数:7,代码来源:RestaurantsTableSeeder.php
示例6: 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"));
}
开发者ID:benji031,项目名称:finduscook,代码行数:16,代码来源:TestAddingRestaurants.php
示例7: productos
public function productos($mozos = null)
{
$recordFinder = new AsyncRecordFinder('Buscar Producto', Restaurant::getInstance()->productos());
$recordFinder->addSearchFieldFree('codigo', 'Codigo');
$recordFinder->addSearchFieldFree('nombre', 'Nombre');
$recordFinder->addTitleField('codigo', 'Codigo');
$recordFinder->addTitleField('nombre', 'Nombre');
return $recordFinder->generateXmlConfiguration();
}
开发者ID:BGCX261,项目名称:zoorestaurant-svn-to-git,代码行数:9,代码来源:AsyncSearch.class.php
示例8: delete
function delete()
{
$restaurants = Restaurant::getAll();
foreach ($restaurants as $restaurant) {
if ($restaurant->getCuisineId() == $this->getId()) {
$restaurant->delete();
}
}
$GLOBALS['DB']->exec("DELETE FROM cuisines WHERE id = {$this->getId()};");
}
开发者ID:juliocesardiaz,项目名称:Best-restaurants,代码行数:10,代码来源:Cuisine.php
示例9: find
static function find($search_id)
{
$found_restaurant = null;
$restaurants = Restaurant::getAll();
foreach ($restaurants as $restaurant) {
$restaurant_id = $restaurant->getId();
if ($restaurant_id == $search_id) {
$found_restaurant = $restaurant;
}
}
return $found_restaurant;
}
开发者ID:anniehoogendoorn,项目名称:BestRestaurants,代码行数:12,代码来源:Restaurant.php
示例10: initialize
public function initialize($entity = null, $options = null)
{
$restaurant = new Select('restaurantid', Restaurant::find(), array('using' => array('id', 'name'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Restaurante')));
$restaurant->setLabel('Pais');
$this->add($restaurant);
$name = new Text('name');
$name->setLabel('Name');
$this->add($name);
$active = new Select("active", array('Y' => $this->di->get('translate')->_('Yes'), 'N' => $this->di->get('translate')->_('No')), array('class' => 'form-control'));
$active->setLabel('active');
$this->add($active);
}
开发者ID:andresfranco,项目名称:Phalcontest,代码行数:12,代码来源:MenuForm.php
示例11: restaurantInfo
public function restaurantInfo()
{
$user = \Auth::user();
$id = $user->user_id;
$restaurant = \Restaurant::all();
foreach ($restaurant as $rest) {
$restaurant_name = $rest->restaurant_name;
$restaurant_street_1 = $rest->restaurant_street_1;
$restaurant_street_2 = $rest->restaurant_street_2;
$restaurant_phone = $rest->restaurant_phone;
$restaurant_email = $rest->restaurant_email;
}
return \View::make('restaurant.edit')->withRestaurantName($restaurant_name)->withRestaurantStreet_1($restaurant_street_1)->withRestaurantStreet_2($restaurant_street_2)->withRestaurantPhone($restaurant_phone)->withRestaurantEmail($restaurant_email);
}
开发者ID:adamyWA,项目名称:Menu-CMS,代码行数:14,代码来源:UpdateRestaurantInfo.php
示例12: addReview
public function addReview($data)
{
$this->user_id = $data['user_id'];
$this->restaurant_id = $data['restaurant_id'];
$this->content = $data['content'];
$this->rating = $data['rating'];
$this->created_at = $data['created_at'] = date('Y-m-d H:i:s');
$this->updated_at = $data['updated_at'] = date('Y-m-d H:i:s');
if ($this->create($data)) {
$restaurants = new Restaurant();
$restaurant = $restaurants->find('id', $this->restaurant_id);
$review_count = intval($restaurant['review_count']);
$rating = $review_count * intval($restaurant['rating']) + intval($this->rating);
$review_count += 1;
$rating /= $review_count;
$restaurants->update('id', $this->restaurant_id, ['rating' => $rating, 'review_count' => $review_count]);
$result['status'] = "success";
$result['success_text'] = "review added";
} else {
$result['status'] = "error";
$result['error_text'] = "review not added";
}
return json_encode($result);
}
开发者ID:manikanthtalasu,项目名称:restaurant-finder,代码行数:24,代码来源:review.php
示例13: buildAtms
public function buildAtms($xml)
{
$pageOffset = (string) $xml->PageOffset;
$totalCount = (string) $xml->TotalCount;
$restaurantArray = array();
foreach ($xml->Restaurant as $restaurant) {
$tmpRestaurant = new Restaurant();
$tmpRestaurant->setId((string) $restaurant->Id);
$tmpRestaurant->setName((string) $restaurant->Name);
$tmpRestaurant->setWebsiteUrl((string) $restaurant->WebsiteUrl);
$tmpRestaurant->setPhoneNumber((string) $restaurant->PhoneNumber);
$tmpRestaurant->setCategory((string) $restaurant->Category);
$tmpRestaurant->setLocalFavoriteInd((string) $restaurant->LocalFavoriteInd);
$tmpRestaurant->setHiddenGemInd((string) $restaurant->HiddenGemInd);
$tmpLocation = new Location();
$location = $restaurant->Location;
$tmpLocation->setName((string) $location->Name);
$tmpLocation->setDistance((string) $location->Distance);
$tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
$tmpAddress = new Address();
$address = $location->Address;
$tmpAddress->setLine1((string) $address->Line1);
$tmpAddress->setLine2((string) $address->Line2);
$tmpAddress->setCity((string) $address->City);
$tmpAddress->setPostalCode((string) $address->PostCode);
$tmpCountry = new Country();
$tmpCountry->setName((string) $address->Country->Name);
$tmpCountry->setCode((string) $address->Country->Code);
$tmpCountrySubdivision = new CountrySubdivision();
$tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
$tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
$tmpAddress->setCountry($tmpCountry);
$tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
$tmpPoint = new Point();
$point = $location->Point;
$tmpPoint->setLatitude((string) $point->Latitude);
$tmpPoint->setLongitude((string) $point->Longitude);
$tmpLocation->setPoint($tmpPoint);
$tmpLocation->setAddress($tmpAddress);
$tmpRestaurant->setLocation($tmpLocation);
array_push($restaurantArray, $tmpRestaurant);
}
$restaurants = new Restaurants($pageOffset, $totalCount, $restaurantArray);
return $restaurants;
}
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:45,代码来源:RestaurantsLocalFavoritesService.php
示例14: abrir
/**
* abre la mesa y setea el mozo
* @param Mozo $mozo
*/
public function abrir($mozo)
{
//$this->getPedido()->vaciar();
if (!$this->getEstado()->equals(EstadoMesa::abierta())) {
$this->setFechaAbierta(DateUtil::formatAsTimeStamp(time()));
$this->setearMozoYEstado($mozo, EstadoMesa::abierta());
$pedido = new Pedido();
//$pedido->setNumero(21);//clase aca
//$pedido->setFecha($this->getFechaAbierta());
$restaurant = Restaurant::getInstance()->agregarPedido($pedido);
$pedido->save();
$this->setPedido($pedido);
return true;
}
return false;
}
开发者ID:BGCX261,项目名称:zoorestaurant-svn-to-git,代码行数:20,代码来源:Mesa.class.php
示例15: construct
public function construct()
{
if ($this->isNew()) {
try {
parent::construct();
$this->setEstado(EstadoPedido::pendiente());
$this->setFecha(DateUtil::formatAsTimeStamp(time()));
$this->setNumero(Restaurant::getInstance()->pedidos()->count() + 1);
} catch (Exception $e) {
/**
* This try/catch clause is necessary to prevent the Doctrine data loader command from
* failing.
*
*/
}
}
}
开发者ID:BGCX261,项目名称:zoorestaurant-svn-to-git,代码行数:17,代码来源:Pedido.class.php
示例16: Users
<?php
global $global_params;
global $page_params;
$page_params['page_title'] = "Feedback";
$pageArgs = $global_params['page_arguments'];
$users = new Users();
$restObj = new Restaurant();
$restId = $_SESSION[SESSION_REST_ID];
$seatedCusts = $restObj->getSeatedCustsHtml($restId);
开发者ID:pranav6487,项目名称:pet_project,代码行数:10,代码来源:feedback_init.php
示例17: testDeleteCuisineRestaurants
function testDeleteCuisineRestaurants()
{
//Arrange
$flavor = "Pizza";
$id = null;
$test_cuisine = new Cuisine($flavor, $id);
$test_cuisine->save();
$name = "Pizza Party";
$phone_number = "123-123-1234";
$address = "1234 Pepporoni Lane";
$cuisine_id = $test_cuisine->getId();
$test_restaurant = new Restaurant($name, $phone_number, $address, $id, $cuisine_id);
$test_restaurant->save();
//Act
$test_cuisine->delete();
//Assert
$this->assertEquals([], Restaurant::getAll());
}
开发者ID:JordanNavratil,项目名称:Best_Restaurant,代码行数:18,代码来源:CuisineTest.php
示例18: getOffTimes
public function getOffTimes($request)
{
if ($this->checkDetails($request)) {
$restObject = new Restaurant();
$array = $restObject->getOfficialTime($request["restaurantID"]);
return $array;
}
}
开发者ID:veron123,项目名称:BaseW,代码行数:8,代码来源:controller1.php
示例19: catch
} catch (Exception $e) {
$errormessage = $e->getMessage();
trigger_error($errormessage, E_USER_WARNING);
$formmessage = $errormessage;
$formmessageclass = 'red';
break;
}
} else {
header("Location: logout");
exit;
}
}
} while (1 == 0);
try {
include "common/token.php";
$restaurant = Restaurant::get($restaurantid, $userid);
$publish = $restaurant->getProperty('publish');
$restaurantname = $restaurant->getProperty('name');
$restaurantwebsite = $restaurant->getProperty('website');
$cuisineid = $restaurant->getProperty('cuisineid');
} catch (Exception $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
header("Location: restaurants");
exit;
}
?>
<body>
<?php
include "topnavbar.php";
include "restohierarchy.php";
$hierarchy[RESTAURANT] = array('id' => $restaurantid, 'name' => $restaurantname);
开发者ID:auimendoza,项目名称:appfoodsyadmin,代码行数:31,代码来源:editrestaurant.php
示例20: test_deleteReviews
function test_deleteReviews()
{
$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();
$restaurant_name2 = "The Red Dragon";
$location2 = "899 SW 5th Ave, Portland, OR";
$description2 = "A Intense Asian experince";
$price2 = "\$\$\$";
$cuisine_id2 = $test_cuisine->getId();
$test_restaurant2 = new Restaurant($restaurant_name2, $location2, $description2, $price2, $cuisine_id2);
$test_restaurant2->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_restaurant->delete();
$result = Review::getAll();
//var_dump($result);
$this->assertEquals([], $result);
}
开发者ID:juliocesardiaz,项目名称:Best-restaurants,代码行数:39,代码来源:RestaurantTest.php
注:本文中的Restaurant类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论