当前位置: 首页>>代码示例>>PHP>>正文


PHP Place::setMeetupLocation方法代码示例

本文整理汇总了PHP中Place::setMeetupLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::setMeetupLocation方法的具体用法?PHP Place::setMeetupLocation怎么用?PHP Place::setMeetupLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place::setMeetupLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

    return $app['twig']->render('login.html.twig');
});
$app->get("/logged_on", function () use($app) {
    $user_name = $_GET['username'];
    $user = User::findByUserName($user_name);
    $user_logged = $user->logIn($user_name, $_GET['password']);
    if ($user_logged == "Wrong Password") {
        return $app['twig']->render('login.html.twig');
    } else {
        return $app['twig']->render('users.html.twig', array('user' => $user_logged, 'avialable_users' => $user->findUsersNear(), 'requests' => $user->findMeetupRequests()));
    }
});
$app->post("/request_meetup", function () use($app) {
    $user1 = User::find($_POST['user1_id']);
    $user2 = User::find($_POST['user2_id']);
    $location = Place::setMeetupLocation($user1, $user2);
    $user1->addMeetUpRequest($user2->getId(), $location->getId());
    return $app['twig']->render('waiting_to_confirm.html.twig', array('user1_id' => $user1->getId(), 'user2_id' => $user2->getId()));
});
//waiting for request respond page
$app->get("/wait_for_confirmation", function () use($app) {
    $user1 = User::find($_GET['user1_id']);
    $user2 = User::find($_GET['user2_id']);
    if ($user1->hasUserTwoConfirmed($user2->getId()) == NULL) {
        return $app['twig']->render('waiting_to_confirm.html.twig', array('user1_id' => $user1->getId(), 'user2_id' => $user2->getId()));
    } else {
        if ($user1->hasUserTwoConfirmed($user2->getId())) {
            $location = Place::getMeetUpLocation($user1->getId(), $user2->getId());
            return $app['twig']->render('confirmed_user1.html.twig', array('user_to_meet' => $user2, 'user' => $user1, 'location' => $location));
        } else {
            return $app['twig']->render('rejected.html.twig', array('user' => $user1, 'user_to_meet' => $user2));
开发者ID:juliocesardiaz,项目名称:Face2Face,代码行数:31,代码来源:app.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::setMeetupLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。