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


PHP ConnectionFactory::updateTableRowAbsoluteBasic方法代码示例

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


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

示例1: completeMission

 public function completeMission($mission)
 {
     $completeParams = array();
     $completeParams['times_complete'] = 1;
     $this->times_complete++;
     $cityRank = ConnectionFactory::SelectValue("rank_avail", "users_cities", array("user_id" => $this->user_id, "city_id" => $mission->getCityID()));
     switch ($cityRank) {
         case 1:
             $completeParams['rank_one_times'] = 1;
             $this->rank_one_times++;
             break;
         case 2:
             $completeParams['rank_two_times'] = 1;
             $this->rank_two_times++;
             break;
         case 3:
             $completeParams['rank_three_times'] = 1;
             $this->rank_three_times++;
             break;
     }
     $currRank = $this->curr_rank;
     $userTimesFinishedRankForMission = $this->getRankTimes($currRank);
     /*
     		if ($cityRank == $currRank) {	//this is cause we need to incorporate changes above
     			$userTimesFinishedRankForMission++;		//that have not hit db yet
     		}
     */
     $missionRequirementToFinishRank = $mission->getRankReqTimes($currRank);
     $unlockedMissionRank = false;
     if ($userTimesFinishedRankForMission >= $missionRequirementToFinishRank) {
         if ($userTimesFinishedRankForMission == $missionRequirementToFinishRank) {
             if ($currRank <= 3) {
                 $_SESSION['justUnlockedThisMissionRank'] = $currRank + 1;
                 $_SESSION['justUnlockedRankMissionName'] = $mission->getName();
                 $unlockedMissionRank = true;
                 $completeParams['curr_rank'] = 1;
                 $this->curr_rank++;
             } else {
                 return;
             }
         }
     }
     $cityID = $mission->getCityID();
     $success = ConnectionFactory::updateTableRowRelativeBasic("users_missions", $completeParams, array("user_id" => $this->user_id, "mission_id" => $mission->getID()));
     if ($unlockedMissionRank && $this->allMissionsInCityReadyForNextLevel($currRank + 1, $cityID, $this->user_id)) {
         if (!ConnectionFactory::updateTableRowAbsoluteBasic("users_cities", array("rank_avail" => $currRank + 1), array("user_id" => $this->user_id, "city_id" => $cityID))) {
             redirect($GLOBALS['serverRoot'] . "/errorpage.html");
         }
         $_SESSION['justUnlockedThisCityRank'] = $currRank + 1;
         $_SESSION['justUnlockedRankMissionName'] = $mission->getName();
     }
 }
开发者ID:ng2k12,项目名称:MercInc,代码行数:52,代码来源:UserMissionData.php

示例2: setType

 public function setType($playerType)
 {
     ConnectionFactory::updateTableRowAbsoluteBasic("users", array('type' => $playerType), array('id' => $this->id));
     $this->type = $playerType;
 }
开发者ID:ng2k12,项目名称:MercenaryInc,代码行数:5,代码来源:User.php

示例3: updateUserC2DMRegistrationToken

 public static function updateUserC2DMRegistrationToken($udid, $registrationToken)
 {
     $params = array();
     $conditions = array();
     $params['c2dm_token'] = $registrationToken;
     $conditions['udid'] = $udid;
     $success = ConnectionFactory::updateTableRowAbsoluteBasic("users", $params, $conditions);
     return $success;
 }
开发者ID:ng2k12,项目名称:MercInc,代码行数:9,代码来源:User.php


注:本文中的ConnectionFactory::updateTableRowAbsoluteBasic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。