當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Place::generateLocation方法代碼示例

本文整理匯總了PHP中Place::generateLocation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Place::generateLocation方法的具體用法?PHP Place::generateLocation怎麽用?PHP Place::generateLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Place的用法示例。


在下文中一共展示了Place::generateLocation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_generateLocation

 function test_generateLocation()
 {
     $place_name = "Bombay Chaat House";
     $address = "804 SW Yamhill St";
     $latitude = 43.51983;
     $longitude = -122.68437;
     $id = 1;
     $test_place = new Place($place_name, $address, $latitude, $longitude, $id);
     $test_place->save();
     $place_name2 = "Nordstrom Downtown Portland";
     $address2 = "701 SW Broadway";
     $latitude2 = 45.519229;
     $longitude2 = -122.680314;
     $id2 = 2;
     $test_place2 = new Place($place_name2, $address2, $latitude2, $longitude2, $id2);
     $test_place2->save();
     $place_name3 = "Banana Republic";
     $address3 = "710 SW Yamhill St";
     $latitude3 = 45.518594;
     $longitude3 = -122.680357;
     $id3 = 3;
     $test_place3 = new Place($place_name3, $address3, $latitude3, $longitude3, $id3);
     $test_place3->save();
     $result = Place::generateLocation();
     $this->assertEquals(true, is_object($result));
 }
開發者ID:juliocesardiaz,項目名稱:Face2Face,代碼行數:26,代碼來源:PlaceTest.php

示例2: setMeetupLocation

 static function setMeetupLocation($user1, $user2)
 {
     $temp_location = Place::generateLocation();
     if ($temp_location->verifyLocation($user1, $user2)) {
         return $temp_location;
     } else {
         Place::setMeetupLocation($user1, $user2);
     }
 }
開發者ID:juliocesardiaz,項目名稱:Face2Face,代碼行數:9,代碼來源:Place.php


注:本文中的Place::generateLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。