本文整理汇总了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();
}
}
示例2: setType
public function setType($playerType)
{
ConnectionFactory::updateTableRowAbsoluteBasic("users", array('type' => $playerType), array('id' => $this->id));
$this->type = $playerType;
}
示例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;
}