public static function team(Team $team) { $forJSON = array("level" => $team->getLevel(), "experience" => $team->getExperience(), "money" => $team->getMoney(), "realMoney" => $team->getRealMoney(), "studyPoints" => $team->getStudyPoints(), "energy" => $team->getCurrentEnergy(), "energyMax" => floor($team->getEnergyMax()), "trainerId" => $team->getTrainerId(), "teamName" => $team->getTeamName(), "teamLogoId" => $team->getTeamLogoId(), "paramForward" => $team->getParameterForward(), "paramHalf" => $team->getParameterHalf(), "paramSafe" => $team->getParameterSafe(), "isInstalled" => $team->getIsInstalled(), "socialUserId" => $team->getSocialUserId(), "userPhoto" => $team->getUserPhoto(), "userName" => $team->getUserName(), "isInTeam" => $team->getIsInTeam(), "studyPointsViaPrize" => $team->getStudyPointsViaPrize(), "inGroup" => $team->getInGroup(), "counterChoose" => $team->getCounterChoose(), "counterWon" => $team->getCounterWon(), "counterLose" => $team->getCounterLose(), "stadiumId" => $team->getStadiumId(), "needDailyBonus" => $team->isNeedDailyBonus(), "placeCountry" => $team->getPlaceCountry(), "placeCity" => $team->getPlaceCity(), "placeUniversity" => $team->getPlaceUniversity(), "placeVK" => $team->getPlaceVK(), "tourIIIcounter" => $team->getTourIII(), "tourPlaceCountry" => $team->getTourPlaceCountry(), "tourPlaceCity" => $team->getTourPlaceCity(), "tourPlaceUniversity" => $team->getTourPlaceUniversity(), "tourPlaceVK" => $team->getTourPlaceVK(), "tourNotify" => $team->getTourNotify(), "tourBonus" => $team->getTourBonus(), "tourBonusTime" => $team->getTourBonusTime(), "counterChoose" => $team->getCounterChoose(), "counterWon" => $team->getCounterWon(), "counterLose" => $team->getCounterLose(), "totalPlace" => $team->getTotalPlace(), "place" => isset($team->place) ? $team->place : 99); if (count($team->getFootballers())) { $forJSON["footballers"] = JSONPrepare::footballers($team->getFootballers()); } if (count($team->getSponsors())) { $forJSON["sponsors"] = JSONPrepare::sponsors($team->getSponsors()); } return $forJSON; }
public static function getPrizeStudyPoint($teamId) { $teamInstance = RAM::getInstance()->getTeamById($teamId); if (!empty($teamInstance)) { $team = new Team(); $team->initFromRAM($teamInstance); return $team->getStudyPointsViaPrize(); } $sql_template = "SELECT prize_stady_point FROM teams\nWHERE\n vk_id = %d"; $sql = sprintf($sql_template, $teamId); $SQLResult = SQL::getInstance()->query($sql); if ($SQLResult instanceof ErrorPoint) { return $SQLResult; } if ($SQLResult->num_rows) { $loadedTeam = $SQLResult->fetch_object(); return $loadedTeam->prize_stady_point; } }
public function initFromRAM(Team $team) { $this->socialUserId = $team->getSocialUserId(); $this->setLevel($team->getLevel()); $this->setExperience($team->getExperience()); $this->setMoney($team->getMoney()); $this->setRealMoney($team->getRealMoney()); $this->setStudyPoints($team->getStudyPoints()); $this->setStudyPointsViaPrize($team->getStudyPointsViaPrize()); $this->setInGroup($team->getInGroup()); $this->setParameterForward($team->getParameterForward()); $this->setParameterHalf($team->getParameterHalf()); $this->setParameterSafe($team->getParameterSafe()); $this->setEnergy($team->getCurrentEnergy()); $this->setMaxEnergy($team->getEnergyMax()); $this->trainerId = $team->getTrainerId(); $this->teamName = trim($team->getTeamName()); $this->teamLogoId = $team->getTeamLogoId(); $this->inTeam = $team->getIsInTeam(); $this->isAbleToChoose = $team->getIsAbleToChoose(); $this->userPhoto = trim($team->getUserPhoto()); $this->userName = trim($team->getUserName()); $this->counterWon = $team->getCounterWon(); $this->counterChoose = $team->getCounterChoose(); $this->counterLose = $team->getCounterLose(); $this->counterTie = $team->getCounterTie(); $this->stadiumId = $team->getStadiumId(); $this->setUserCountry($team->getUserCountry()); $this->setUserCity($team->getUserCity()); $this->setUserUniversity($team->getUserUniversity()); $this->setPlaceCountry($team->getPlaceCountry()); $this->setPlaceCity($team->getPlaceCity()); $this->setPlaceUniversity($team->getPlaceUniversity()); $this->setPlaceVK($team->getPlaceVK()); $this->setTourIII($team->getTourIII()); $this->setDailyBonus($team->isNeedDailyBonus()); $this->setTourPlaceCountry($team->getTourPlaceCountry()); $this->setTourPlaceCity($team->getTourPlaceCity()); $this->setTourPlaceUniversity($team->getTourPlaceUniversity()); $this->setTourPlaceVK($team->getTourPlaceVK()); $this->setTourNotify($team->getTourNotify()); $this->setTourBonus($team->getTourBonus()); $this->setTourBonusTime($team->getTourBonusTime()); $this->setIsPrized($team->getIsPrized()); $this->setParameterSum($team->getParameterSum()); $this->setTotalPlace($team->getTotalPlace()); $this->setAllFootballersCount($team->getAllFootballersCount()); $this->setAllFootballersFriendsCount($team->getAllFootballersFriendsCount()); $this->setSponsorsCount($team->getSponsorsCount()); }